Page 1 of 2

Ionic 4 - InAppBrowser

Posted: Wed Jun 24, 2020 12:53 pm
by Dupdroid

I followed the instructions below in my Ionic 4 app and I get the following error:

ERROR in src/app/Screen1/Screen1.ts:31:28 - error TS2339: Property 'InAppBrowser' does not exist on type 'Cordova'.

https://docs.appery.io/docs/cordova-i...

Code as per Appery tutorial:

codeif (window.cordova) {
cordova.InAppBrowser.open('https://www.google.com', '_self', 'location=yes');
} else {
console.log('no cordova');
}/code

I have also tried:

codeif (window.cordova) {
window.cordova.InAppBrowser.open('https://www.google.com', '_self', 'location=yes');
} else {
console.log('no cordova');
}/code


Ionic 4 - InAppBrowser

Posted: Wed Jun 24, 2020 4:55 pm
by Serhii Kulibaba

Hello,

This example works for JQM apps, but not for Ionic 4.

Please use the following code for Ionic 4 applications: pre(window).cordova.InAppBrowser.open("https://google.com") - так /pre


Ionic 4 - InAppBrowser

Posted: Thu Jun 25, 2020 6:03 am
by Dupdroid

Still getting the same error:

codeERROR in src/app/Screen1/Screen1.ts:36:30 - error TS2339: Property 'InAppBrowser' does not exist on type 'Cordova'. 36 (window).cordova.InAppBrowser.open('https://www,google.com');/code


Ionic 4 - InAppBrowser

Posted: Fri Jun 26, 2020 1:17 pm
by Dupdroid

Hi Serhii, can you please get back to me on this issue? The code you provided does not work.


Ionic 4 - InAppBrowser

Posted: Fri Jun 26, 2020 2:30 pm
by Serhii Kulibaba

Sorry, getsatisfaction changed the code... the correct is:

pre(<any>window)&#46;cordova&#46;InAppBrowser&#46;open("https:&#47;&#47;google&#46;com");/pre


Ionic 4 - InAppBrowser

Posted: Fri Jun 26, 2020 2:51 pm
by Dupdroid

Still no luck...

core.js:9110 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'InAppBrowser' of undefined


Ionic 4 - InAppBrowser

Posted: Fri Jun 26, 2020 6:58 pm
by Serhii Kulibaba

Have you enabled the inAppBrowser plugin?

Do you run the application on the real device, not in the browser? (inAppBrowser doesn't work in a simple browser, please use window.open there)


Ionic 4 - InAppBrowser

Posted: Mon Jun 29, 2020 7:15 am
by Dupdroid

Yes, I am testing on a real iPhone.

This my code:

codetry {
if (( < any > window)&#46;cordova) {
alert('cordova found');
( < any > window)&#46;cordova&#46;InAppBrowser&#46;open('https:&#47;&#47;www&#46;google&#46;com');
} else {
alert('cordova not found');
( < any > window)&#46;open('https:&#47;&#47;www&#46;google&#46;com', '_self');
}
} catch (err) {
alert(err&#46;message);
}/code

See screenshot.

Image

This is really frustrating. Can you please assist?


Ionic 4 - InAppBrowser

Posted: Mon Jun 29, 2020 1:08 pm
by Dupdroid

Also, if I activate Auto Updates by checking the checkbox on the IOS binary tab and checking the "Hot Code Push Plugin" then the App simple crashes on the iPhone.


Ionic 4 - InAppBrowser

Posted: Tue Jun 30, 2020 1:02 pm
by Serhii Kulibaba

Please share (https://docs.appery.io/docs/teams-sha...) your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a and provide us with the app name. It seems you didn't include the inAppBrowser plugin or something else. We will check it