Welcome! › Forums › Unity Plugins › In-App Web Browser › Callback on iOS 13 not working from javascript
- This topic has 9 replies, 3 voices, and was last updated 5 years ago by
Piotr.
-
AuthorPosts
-
December 5, 2019 at 7:59 pm #1900
Brathnann
ParticipantWe are using In app web browser in our app and it was working fine for us. However, we had some reports that when a user tapped on a link, nothing was happening. We discovered the iOS 13 issue and updated to the latest version on the asset store. Now, the webpage pops up, but the callback to the app isn’t working on iOS. It still works on Android. It worked previously on older iOS versions though.
I took another look and everything still matches the suggested way to set it up in the docs, so I’m a bit lost on why it doesn’t work anymore.
Any help would be appreciated. Thank you.
December 6, 2019 at 12:07 am #1903Piotr
KeymasterHey,
Which callback do you have in mind? 🙂
December 6, 2019 at 8:45 am #1906Brathnann
ParticipantIt’s the sending a message from javascript to Unity where we have to create the iframe. It worked before, but then we had several iOS users saying the link wasn’t doing anything from within the app. I updated the plugin and now the webpage opens, it just doesn’t send the callback to the app from the javascript so it never triggers the method it needs to on iOS anymore.
I have properly subscribed to the onJSCallback.
December 6, 2019 at 11:25 am #1911Piotr
KeymasterAs mentioned on Asset Store 2.0 changes the way you communicate from JS to Unity.
Check docs for a details, but essentially you need to do this:
webkit.messageHandlers.UnityInAppBrowser.postMessage(‘your message goes here’);
December 6, 2019 at 4:04 pm #1912Brathnann
ParticipantThank you, this change wasn’t showing up in the doc for me. My web guy and I were looking for it. Looks like it’s showing up now for me in the docs.
However, this new way doesn’t appear to be working either still on my iphone 7 test device which has iOS 13.2.3.
It did fix the issue on my iPhone 6 test device which runs iOS 11.4.
December 6, 2019 at 7:58 pm #1913Piotr
KeymasterIs sample scene working for you?
December 6, 2019 at 8:07 pm #1914Brathnann
ParticipantI’ll see if I can set it up, but honestly, it’s no different then what we have. Subscribe to the bridge, and then do a callback through a javascript, so I don’t expect to see any different results.
December 6, 2019 at 9:00 pm #1915Brathnann
ParticipantThank you, finally got it working. For some reason it was still thinking we had the old javascript file in there and wouldn’t clear it. I was able to find in the logs where it was still trying to execute the old javascript.
ClearCache didn’t help it and I know I had uninstalled and reinstalled many times trying to get it to work, so I’m not sure why it finally picked up the new js file.
Appreciate the help.
February 4, 2020 at 2:23 pm #1989sotiris
ParticipantHello, same problem here. Replaced the old way with iframe to the
webkit.messageHandlers.UnityInAppBrowser.postMessage(‘your message goes here’);
when it comes to iOS.Android works perfect with UnityInAppBrowser.sendMessageFromJS(‘your message goes here’);
ios no luck. before updating it worked in both iphone and android..
February 4, 2020 at 2:30 pm #1990Piotr
KeymasterIs sample scene working for you?
-
AuthorPosts
- You must be logged in to reply to this topic.