Runtime error in IAB 2.0.1- 'SendMessage: object InAppBrowserBridge not found!'

Welcome! Forums Unity Plugins In-App Web Browser Runtime error in IAB 2.0.1- 'SendMessage: object InAppBrowserBridge not found!'

Tagged: 

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1778
    SanketSanket
    Participant

    Hi Piotr,

    Recently I upgraded to InAppBrowser 2.0.1 in my iOS project with unity 2019.2.0 and I am facing an issue while opening any link in the in app browser. Whenever I open the link in the in app browser, it opens the browser and the loader starts and stays on forever. In the logs it says ‘SendMessage: object InAppBrowserBridge not found!’.

    I saw in the Plugins/iOS folder the InAppBrowser.a in present and still the issue. Please tell me why is it not able to open the webpage?

    #1779
    PiotrPiotr
    Keymaster

    Is sample scene working for you? Its in Examples directory. The log message you mentioned is just a warning saying you did not put InAppBrowserBridge prefab on a scene.

    #1808
    SanketSanket
    Participant

    Hi Piotr,

    Thanks for the quick response.

    Now yes, the sample scene works and the warning message seems to be understandable.

    But now that I saw the issue properly, it appears that non-HTTPS URLs like (https://www.kokosoft.pl) are not opening in the InAppBrowser in the iOS app with the 2.0.1 version of IAP. Now as made mandatory for iOS apps, I disable the ‘Allow downloads over HTTP (nonsecure)’ box in Unity iOS Player Settings for the sample scene of IAP and build it. And in this case, I am able to open all HTTPS-based websites URLs but non-HTTPS based URLs do not open in the InAppBrowser with the loader staying on forever. Also, it does not throw any error in the logs.

    Now it does work if I enable the ‘Allow downloads over HTTP (nonsecure)’ box in the iOS Player Settings but again I need it to be disabled for publishing the app to the App Store.

    Is it an issue in IAP or am I missing something?

    #1816
    SanketSanket
    Participant

    Hi Piotr,

    Were you able to reproduce the issue?

    #1817
    PiotrPiotr
    Keymaster

    Hi,
    I am out until Tuesday. Will check then.

    #1825
    SanketSanket
    Participant

    Hi Piotr!
    Do you have any update on this now?

    • This reply was modified 1 year, 11 months ago by SanketSanket.
    #1867
    SanketSanket
    Participant

    Hi Piotr,

    Please update on this issue. Were you able to reproduce this at your end?

    #1873
    PiotrPiotr
    Keymaster

    Sorry, I don’t get your issue. If you disable HTTP download you won’t be able to open any HTTP links – it’s pretty clear, right? You might add some exception URLs, like here:
    tutorial
    stack overflow question

    This question isn’t really related to plugin itself – it’s about all URLs your app is using.

    #1876
    SanketSanket
    Participant

    Ok, let me explain.

    I have InAppBrowser integrated into my Unity iOS app for opening any/all URLs in an internal browser instead of sending the user off to an external browser app. Now the URLs could be either http:// or https:// based on the website the Url belongs to and I have couple of http:// based website URLs and a couple of https:// based website URLs.

    Now in the player settings of my Unity iOS app if I disable ‘Allow downloads over HTTP (nonsecure)’ checkbox(for publishing on App Store) and build the app, http:// based URLs are not opening in the InAppBrowser. The InAppBrowser panel opens but the webpage does not load and loader stays on forever.

    To reproduce this issue, simply open the ExampleScene from InAppBrowser asset in a Unity iOS project and set the URL as ‘https://www.kokosoft.pl/’ in the URL box in the BrowserOpener component. Then disable the ‘Allow downloads over HTTP (nonsecure)’ checkbox in the iOS player settings and build it. The webpage at the url ‘https://www.kokosoft.pl/’ will not load in the InAppBrowser.

    Please try this once and let me know if you are able to reproduce this at your end.

    #1877
    PiotrPiotr
    Keymaster

    Yes, I got you. I just don’t understand how it’s an “issue” in your opinion. You block any traffic over HTTP from your app so it’s rather obvious that http links will not work.

    If you want use HTTP you should modify your Info.plist as explained here: https://pinkstone.co.uk/how-to-fix-http-load-errors-in-xcode/

    Don’t know what’s the proper way of doing it from Unity, but you can probably find it in docs.

    #1879
    SanketSanket
    Participant

    See Piotr, I considered this as an issue as for me a browser should open any kind of URL as long as the URL is active and valid, irrespective of whether the URL has http:// or https://. The requirement of an SSL certificate on webservers for iOS apps can be considered valid as Apple wants its devices to communicate securely with the web servers. But a mobile web browser on iOS devices should open all kinds of web pages even the ones without the SSL certificate. And we already see this happening all browser apps like Chrome, Firefox, etc. which must be following the protocol to communicate with their web servers but allows to open any and all kind of URLs.

    Now, in this case, an InAppBrowser is expected to work similar to a web browser inside an app and open any and all kinds of active and valid URLs. I hope you understand this as a justifiable expectation. Your solution of adding App Transport Security in Xcode did work for me and for unity we can create a post process build monobehaviour to add this to the Info.plist after the Xcode project is built to avoid manually changing this in Xcode. You can find a reference to this method here – https://answers.unity.com/questions/1431654/app-transport-security-has-blocked-a-cleartext-htt.html

    Now, as far as cross-platform capabilities and other features of an in-app browser are concerned, IAB asset does an excellent job. I hope you come up with a more robust solution for this as well.

    Regards,
    Sanket.

    #1881
    PiotrPiotr
    Keymaster

    iOS third party browsers like Chrome are using the same approach, by using NSAllowsArbitraryLoads option, the same you posted from your link.

    You can see it here:
    https://gitlab.collabora.com/web/chromium/blob/master/ios/chrome/app/resources/Info.plist

    As a developer I don’t have any control if Apple blocks traffic coming out of your application – it does not matter if you are opening website inside your app or doing regular HTTP request.

    #1883
    SanketSanket
    Participant

    Understood. Thanks for sharing the information and helping me out.

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