Welcome! › Forums › Unity Plugins › In-App Web Browser › Runtime error in IAB 2.0.1- 'SendMessage: object InAppBrowserBridge not found!'
Tagged: plugin error
- This topic has 12 replies, 2 voices, and was last updated 4 years, 9 months ago by Sanket.
-
AuthorPosts
-
October 20, 2019 at 7:49 am #1778SanketParticipant
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?
October 20, 2019 at 5:17 pm #1779PiotrKeymasterIs 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.
October 30, 2019 at 1:01 pm #1808SanketParticipantHi 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?
November 1, 2019 at 8:43 am #1816SanketParticipantHi Piotr,
Were you able to reproduce the issue?
November 1, 2019 at 4:20 pm #1817PiotrKeymasterHi,
I am out until Tuesday. Will check then.November 7, 2019 at 4:58 pm #1825SanketParticipantHi Piotr!
Do you have any update on this now?- This reply was modified 4 years, 10 months ago by Sanket.
November 20, 2019 at 5:15 pm #1867SanketParticipantHi Piotr,
Please update on this issue. Were you able to reproduce this at your end?
November 20, 2019 at 6:20 pm #1873PiotrKeymasterSorry, 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 questionThis question isn’t really related to plugin itself – it’s about all URLs your app is using.
November 21, 2019 at 1:08 pm #1876SanketParticipantOk, 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.
November 21, 2019 at 9:16 pm #1877PiotrKeymasterYes, 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.
November 22, 2019 at 2:26 pm #1879SanketParticipantSee 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.November 22, 2019 at 8:56 pm #1881PiotrKeymasteriOS 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.plistAs 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.
November 25, 2019 at 9:41 am #1883SanketParticipantUnderstood. Thanks for sharing the information and helping me out.
-
AuthorPosts
- You must be logged in to reply to this topic.