Callback on iOS 13 not working from javascript

Welcome! Forums Unity Plugins In-App Web Browser Callback on iOS 13 not working from javascript

Tagged: ,

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1900
    Brathnann
    Participant

    We 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.

    #1903
    PiotrPiotr
    Keymaster

    Hey,

    Which callback do you have in mind? 🙂

    #1906
    Brathnann
    Participant

    It’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.

    #1911
    PiotrPiotr
    Keymaster

    As 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’);

    #1912
    Brathnann
    Participant

    Thank 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.

    #1913
    PiotrPiotr
    Keymaster

    Is sample scene working for you?

    #1914
    Brathnann
    Participant

    I’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.

    #1915
    Brathnann
    Participant

    Thank 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.

    #1989
    sotiris
    Participant

    Hello, 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..

    #1990
    PiotrPiotr
    Keymaster

    Is sample scene working for you?

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.