apache / apache/cordova-plugin-inappbrowser
In IOS url was not open in the ngOnInit function in ionic 3
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 2.2k
- PR merge metrics
- No merged PRs in 30d
Description
# Bug Report
## Problem
Unable to load the url in the ngOnInit function in ionic 3 version
### What is expected to happen?
While opening the app default web link should be open in the mobile app
### What does actually happen?
But it displayed the home page
## Information
### Command or Code
### Environment, Platform, Device
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { InAppBrowser, InAppBrowserOptions } from '@ionic-native/in-app-browser/ngx';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
url: String;
constructor(public navCtrl: NavController, private inAppBrowser: InAppBrowser) {
console.log('testing');
}
ngOnInit(){
console.log('nginit');
this.openWebpage_fun();
}
ionViewDidLoad() {
console.log('ion view load before');
}
openWebpage_fun() {
console.log('ion view load function');
const options: InAppBrowserOptions = {
zoom: 'no',
hidden:'no',
toolbar:'no',
location:'no',
presentationstyle:'fullscreen',
clearcache:'yes',
clearsessioncache:'yes'
}
var url_val='https://google.com';
// Opening a URL and returning an InAppBrowserObject
const browser = this.inAppBrowser.create(url_val, '_blank', options);
// Inject scripts, css and more with browser.X
}
}
### Version information
Cordova: 8.1.2
Platforms: IOS
Plugins: inappbrowser- 3.0.0
CLI - 3.9
Xcode: 10.1
## Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
Contributor guide
Research direction
Start with the HomePage ngOnInit entry point and its call to openWebpage_fun, then reproduce the iOS launch behavior using the shown InAppBrowser.create call and the listed Cordova, plugin, CLI, and Xcode versions. Done means the configured URL opens instead of the home page, with the result confirmed on iOS.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, typescript
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100