google / cordova-plugin-browsertab

A Cordova plugin that provides an interface to in-app browser tabs that exist on some mobile platforms, such as SFSafariViewController on iOS and CustomTabs on Android.
Apache License 2.0
117 stars 147 forks source link

isAvailable is false #38

Open Sireini opened 4 years ago

Sireini commented 4 years ago

In most of the cases the browserTabs work perfectly, but I tested it on multiple devices and than its shows me that its not available.

What to do with this issue?

This is the piece of code I use:

openBrowserTab(url: string) { console.log('URL: ', url); this.browserTab.isAvailable().then(isAvailable => { console.log('openBrowserTab isAvailable', isAvailable); if (isAvailable) { this.browserTab.openUrl(url).then(() => this.cd.detectChanges()); } else { // open URL with InAppBrowser instead or SafariViewController console.log('openBrowserTab isNotAvailable', isAvailable); } }); }

Ionic info:

Ionic:

ionic (Ionic CLI) : 4.12.0 (C:\Users\USER\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : @ionic/angular 4.7.0 @angular-devkit/build-angular : 0.900.2 @angular-devkit/schematics : 9.0.2 @angular/cli : 9.0.0 @ionic/angular-toolkit : 2.0.0

Cordova:

cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1) Cordova Platforms : android 8.1.0 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 3.1.2, (and 28 other plugins)

System:

NodeJS : v13.7.0 (C:\Program Files\nodejs\node.exe) npm : 6.13.7 OS : Windows 10