Open arafhossain opened 3 years ago
Are you waiting for the deviceready event before executing cordova.InAppBrowser.open('www.google.com', '_blank')
?
Documentation could be improved imo, but it does mention it at https://github.com/apache/cordova-plugin-inappbrowser#installation ... just seems to be in odd ordering.
Thanks for mentioning that @breautek, it's certainly something I didn't consider was necessary - but although now I have no errors, simply nothing happens. My updated ineffective code:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady(){
console.log('Called on device ready!')
var ref = cordova.InAppBrowser.open('www.google.com', '_self')
}
A step forward, not there yet.
Have you tried adding a scheme to the URL? For example,
https://www.google.com
instead of just
www.google.com
i'm facing this same issue
My issue seems to disappear when removing cordova.
when calling the InAppBrowser
plugin.
var ref = InAppBrowser.open('https://www.google.com', '_self');
Thanks for mentioning that @breautek, it's certainly something I didn't consider was necessary - but although now I have no errors, simply nothing happens. My updated ineffective code:
document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady(){ console.log('Called on device ready!') var ref = cordova.InAppBrowser.open('www.google.com', '_self') }
A step forward, not there yet.
Did you find any solution to this issue after that @arafhossain?
Bug Report
Problem
What is expected to happen?
I'm trying to get the InAppBrowser function up and working on my Ionic App. I'm following the steps on the page 'https://github.com/apache/cordova-plugin-inappbrowser.' The only installation step it says to do is run 'cordova plugin add cordova-plugin-inappbrowser.' Then it begins discussing basic operations on starting the inAppBrowser.
My code is
I would expect this to open up the Google website in my Ionic Lab Android platform emulator.
What does actually happen?
Instead, I get the error: 'ERROR ReferenceError: cordova is not defined'. Someone else posted a similar question, and the suggested solution was to add a Script tag: ' ' to their index.html file. That didn't work for me - but I wonder why that was even suggested. I didn't install any other packages/run any other commands besides the 'cordova plugin add cordova-plugin-inappbrowser' stated at the top of the Github docs on the InAppBrowser page. What am I missing?
Information
Command or Code
Version information
Checklist