InAppBrowser and callback in app

Anyone has experiment some ways to call a function in ionic app when, for example, a button in pressed in the inappbrowser view?
I’ve found a solution use polling to check some data and activate a callback but don’t really like that.

Thanks in advance.
David.