AddEventListener not working for InAppBrowser

I’m trying to implement AddeventListener to listen ‘Exit’ and ‘LoadStart’ for InAppBrowser in IONIC2

my html

<button (click)="browsersystem('')" > URL</button> 

.TS file

  this.platform.ready().then(() => {
        let browser=open(url, "_system", "location=true"); 
          console.log('Browser Closed');
          alert('Browser Closed');


console.log('Browser STARTED');


No errors on console.

Is there something am i missing ??

Hi I’m trying to get to grips with the InAppBrowser on Ionic 2 as well.

From your code, I’d say that you need to include;

import {InAppBrowser} from 'ionic-native';

then your initialisation line would need to be:

let browser =, "_system", "location=true");

Have you tried that?


I updated ionic-native to 1.3.20 but now…) returns Void and so I don’t know how to add an event listener.
How can I do it?


Yes all the syntax has now changed.

this.browser = new InAppBrowser( this.target_URL, "_blank", "EnableViewPortScale=yes,closebuttoncaption=Done" );

works for me with ionic native 1.3.17

If you’re using event listeners, the syntax is now:

                    () => {
                    err => {
                      console.log("InAppBrowser Loadstop Event Error: " + err);

Hope that helps


With your code I have this error:

Can't resolve all parameters for InAppBrowser: (?, ?, ?).

OK. I just copied it and pasted it from a working app.

I assume that you didn’t use:


and put your desired URL in?

Same goes for the event listener,


is clearly my own code.

No I obviously changed your code and I founded the problem.
With the old code I used providers: [ InAppBrowser ] in the Component declaration and this was the cause of the error. I don’t know why.


1 Like

hey guzs i want to open play store app form my ionic 2 app… how i do that…currently i able to open in InAppBrowser…but i want open app…how i do that?

Never tried it but the only way to do it would be to listen to the browser loadstop event (see above) and then inject a Javascript routine, using

this.browser.injectScript( { code: "document.getElementById("myCheck").click();" } ).then( ()=> {

console.log("button clicked");


to get the app started somehow.

Hey i tried your code but i get below error

TypeError: this.iabRef.on is not a function

Code that i used

iabRef: any;

this.iabRef =’…/PaymentGwRes.html’, ‘_blank’, ‘location=true’);

            () => {
            err => {
                console.log("InAppBrowser loadstart Event Error: " + err);

I have not been using the loadstart event as I could not get it to work.

See if loadstop works, you’ll probably notice that event firing 3 or four times so you’ll have to code around that.

But also, you’re using the wrong syntax for your instance of the InAppBrowser.

As it states above:

this.browser = new InAppBrowser( this.target_URL, “_blank”, “EnableViewPortScale=yes,closebuttoncaption=Done” );


this.iabRef =‘…/PaymentGwRes.html’, ‘_blank’, ‘location=true’);

I’d be interested to hear if the loadstart event works for you.

loadstart, loadstop nothing works…

Finally Fixed… I have delete ionic-native folder and install ionic-native again then install ionic plugin add cordova-plugin-inappbrowser again then it’s start working…

when i write below line…i got error Supplied argument do not match any signature of call target

import {InAppBrowser} from ‘ionic-native’;

this.iabRef = new InAppBrowser(‘build/pages/PaymentGateway/PaymentGwRes.html’, “_blank”, “EnableViewPortScale=yes,closebuttoncaption=Done”);

How i delete native folder and where is that folder?

I’ve never tried to open a page from my own build in the InAppBrowser, I’ve only used external URLs.

Why would you be doing that, just out of interest?

If you want the latest version of Ionic Native, run

npm i --save ionic-native@latest

ionic-native folder is located at under node_modules folder

please take backup of your original ionic-native folder for safety…

after delete this folder you can run following command

npm install ionic-native --save

i want to added payment gateway … so for that i tried to implement payment gateway response listener .
if u have any example for integrate payment gateway…please share with me…i tried to integrate payumoney payment gateway

just force angular changedetection

for debug: