cdeutsch / JsBridge

Simpler bidirectional communication between JavaScript in a UIWebView and C# in your native app.
https://components.xamarin.com/view/jsbridge
MIT License
91 stars 22 forks source link

Working with https web pages #10

Open mobiledev1600 opened 8 years ago

mobiledev1600 commented 8 years ago

Hi,

We are using JsBridge Unified library on Xamarin iOS app to communicate between web page and native functionality. We have a UIWebView which renders a web page and it invokes camera from device to scan a bar code. The library was working fine until we were serving http pages. Recently, we changed them to https and now it is not firing AddEventListener function to invoke camera.

Does this library prevents calls coming from https? Do we need to make any change in the app handle https requests? I also added NSAllowsArbitraryLoads = True flag in Info.plist We really appreciate your help Thanks

cdeutsch commented 8 years ago

I'm not aware of any problems over https but I haven't used this library personally in years.

How are you registering the browser side script? Make sure it's getting registered and isn't blocked by loading it over http on an https page.

mobiledev1600 commented 8 years ago

I guess we are already registering the script

Here is the actual error we saw screen shot 2016-03-24 at 3 11 48 pm

Thanks

cdeutsch commented 8 years ago

Hmmm, it's blocking the custom protocol app://

I don't know a way to configure the WebView to ignore that, unfortunately.

You could look into modifying things so it makes calls to https://yoursite.com/App/fireEvent and then try detect when that Url is accessed instead of relying on the custom url scheme.