Close InAppBrowser when payment completed

367 views Asked by At

I am using InAppBrowser for payment gateway in my ionic app. I have to close it when they completed payment and clicking on Close button. My code,

const options: InAppBrowserOptions = {
    zoom: 'yes',
    location: 'yes'
};
const browser = this.iab.create(production_url, '_self', options);

browser.executeScript({code: "function closeMethod() { alert('close');"+browser.close()+"; })"});

browser.on('exit').subscribe(() => {
    this.navCtrl.setRoot(HomePage);
}, err => {
    console.error(err);
});

I don't know how to close the iab within the html page loading in browser when clicking a button. Above code doesn't work

0

There are 0 answers