cordova-plugin-inappbrowser
cordova-plugin-inappbrowser copied to clipboard
postmessage not available on iOS
Hello
I need to close cordova iab after login, and I would do this with post message from browser in app to hybrid app I've done with this code:
function dLogin() {
var messageObj = {
status: 200,
error: false,
message: "test",
user: {
id: 1,
token: "ABCDEF"
}
};
var stringifiedMessageObj = JSON.stringify(messageObj);
window['webkit'].messageHandlers['cordova_iab'].postMessage(stringifiedMessageObj);
}
Android build: all works fine iOS build: window['webkit'] is not defined. I've tried with:
- window.
- webkit.
- (window as any).webkit
what I'm wrong?
thanks in advance
Any idea how to communicate between page and app on IOS ?
Any update ??? Almost 3 Month without any response.......
This is why I hate ionic and anything related
cordova is probably dying.. I don't understand why those of capacitorjs who have their browserinapp plugin don't implement the postMessage functionality so as to avoid installing these godforsaken plugins
Any update ??? I have this same problem with [email protected]
I recommend you follow up with us here: https://github.com/apache/cordova-discuss/issues
Unfortunately we are not in a position to promise any timelines as an essentially all-volunteer project.
Yeah I think it would be nice if Capacitor can adopt modernization of this kind of functionality.
Sent from my mobile
On Thu, Sep 28, 2023 at 12:51 PM Gustavo Lanza Duarte < @.***> wrote:
Any update ??? I have this same problem with @.***
— Reply to this email directly, view it on GitHub https://github.com/apache/cordova-plugin-inappbrowser/issues/988#issuecomment-1739688526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAL42UAZU7LIF7R4PUJE6O3X4WTJTANCNFSM6AAAAAATVTG76M . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Unfortunately capacitorjs plugin, at this moment, is very limited in functionality
I may be late for the game, but I ran into the same issue and it seems the problem is that cordova cannot access some APIs on domains that are not whitelisted. I was able to solve it by setting navigation target to _blank like so: cordova.InAppBrowser.open(url, '_blank') after doing so webkit becomes available and I was able to send messages back to the app.