InAppBrowser listen for incoming payload natively

Hey, attempting to listen for incoming post back when a user logins into the site which contains data that needs to be registered for a push notification service however I cannot get it to listen for events, I have tried the following two methods and both have failed would appreciate some help.
Method 1:
browser.on(‘message’).subscribe(payload => {
console.log(“Test”)
try {
console.log(“payload:”, payload)
//payload = JSON.parse(payload);
}
catch (e) {
return;
}
//events[payload.type] && eventspayload.type;
});

Method 2:
browser.on(‘loadstop’).subscribe(event => {
browser.executeScript({ code: Object.keys(window).forEach(key => { if (/^on/.test(key)) { window.addEventListener(key.slice(2), event => { return event; }); } });
}).then((data) => console.log(“Document:”, data));