Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

WebRTC: Java->C# conversion - stuck at WebView/JavascriptInterface not seems to work

$
0
0

Background: http://kenneththorman.blogspot.dk/2014/01/goal-cross-platform-android-ios-webrtc.html

Source code at Github: https://github.com/kenneththorman/appspotdemo-mono/tree/TryingToFixWebView

Basically the code gets all the way to where it is loading a html file (https://github.com/kenneththorman/appspotdemo-mono/blob/TryingToFixWebView/Appspotdemo.Mono.Droid/Assets/channel.html) into the webview (https://github.com/kenneththorman/appspotdemo-mono/blob/TryingToFixWebView/Appspotdemo.Mono.Droid/GAEChannelClient.cs#L73).

Now the webview is supposed to take over and do communication over Google App engine. Loading this script with a fixed valid token in a real desktop Chrome/Firefox browser works and I can see the network trafic/communication happening.

But when the webview is supposed to invoke native code using the (https://github.com/kenneththorman/appspotdemo-mono/blob/master/Appspotdemo.Mono.Droid/Assets/channel.html#L22) to call (https://github.com/kenneththorman/appspotdemo-mono/blob/master/Appspotdemo.Mono.Droid/GAEChannelClient.cs#L154) nothing happens.

I have even added a console.log(token) in the html file (just before https://github.com/kenneththorman/appspotdemo-mono/blob/master/Appspotdemo.Mono.Droid/Assets/channel.html#L13) (which is supposed to be logging through the Log.Debug (in the adb logcat)).

So currently I am stuck here, everything just seems to die, and nothing further in the flow seems wired up. I have tried swapping string to Java.Lang.String (as indicated at https://github.com/xamarin/monodroid-samples/blob/master/WebViewJavaScriptInterface/WebViewJavaScriptInterface/JavaScriptInterfaceActivity.cs#L56), but this did not make any difference. Obviously I am missing something here, currently I am at a loss on how to properly trace debug what I am doing wrong.

Any help on how to further debug this would be most welcome.

Regards Kenneth Thorman


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>