How to close Inapp browser pragmatically?

Hi friends,Please help me.I called the in app browser function.After transaction is done in app browser the inappbrowser window should close automatically .
listernBrowser() method handles this event.But window not closing automatically.Please help…

My Code:

private childWindow;

constructor(
private iab: InAppBrowser,
) {
this.listenBrowser();

}

listenBrowser()
{
window.addEventListener(“message”, (e) => {
try {
this.childWindow.close();
self.close();
} catch (error) {
console.log(error);
}
}, false);
}
}

openPayment(){
this.childWindow = this.iab.create(this.funService.apiUrl,’_blank’);
}

You could add 'location=yes' as an attribute.
For example,

openPayment(){
this.childWindow = this.iab.create(this.funService.apiUrl,’_blank’, ‘location=yes’);
}

You could also use the instance members like hide() and close() in resolving your issue.
Check In App Browser(ionic)

please read the question properly. Inappbrowser remains open even after IAB.close().
It goes in the background.