Sending message from the website my inAppBrowser's is to Ionic application

Viewed 141

I am using the Ionic in-app browser in my ionic app, my issue is trying to send post message request from the website my in-appbrowser is to the ionic side. According to the documentation it is like this:

inAppBrowserRef.executeScript({ code: "\
            var message = 'this is the message';\
            var messageObj = {my_message: message};\
            var stringifiedMessageObj = JSON.stringify(messageObj);\
            webkit.messageHandlers.cordova_iab.postMessage(stringifiedMessageObj);"
        });

and the custom message can be handled like this:

inAppBrowserRef.addEventListener('message', messageCallBack);

function messageCallBack(params){
    $('#status-message').text("message received: "+params.data.my_message);
}

problem is I am developing on an android phone so this doesn't work for me. cause by my understanding webkit is for ios browsers (safari...). how do I send a custom message to android devices?

0 Answers
Related