Tagged: plugin error
October 20, 2019 at 7:49 am #1778
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 #1779
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.October 30, 2019 at 1:01 pm #1808
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 #1816
Were you able to reproduce the issue?November 1, 2019 at 4:20 pm #1817
I am out until Tuesday. Will check then.November 7, 2019 at 4:58 pm #1825
Do you have any update on this now?
November 20, 2019 at 5:15 pm #1867
- This reply was modified 2 years, 6 months ago by Sanket.
Please update on this issue. Were you able to reproduce this at your end?November 20, 2019 at 6:20 pm #1873
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:
stack overflow question
This question isn’t really related to plugin itself – it’s about all URLs your app is using.November 21, 2019 at 1:08 pm #1876
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.November 21, 2019 at 9:16 pm #1877
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.November 22, 2019 at 2:26 pm #1879
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.
Sanket.November 22, 2019 at 8:56 pm #1881
iOS third party browsers like Chrome are using the same approach, by using
NSAllowsArbitraryLoadsoption, the same you posted from your link.
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.November 25, 2019 at 9:41 am #1883
Understood. Thanks for sharing the information and helping me out.
- You must be logged in to reply to this topic.