Skip to content

Important note about Windows Phone 8.1 & Windows 8.1

craigomatic edited this page Aug 27, 2014 · 3 revisions

The security model changed in Windows Phone 8.1/Windows 8.1 and as a result window.external.notify only functions for known ContentURIs running over HTTPS. This can be problematic as not all websites have all of their content served over HTTPS.

An alternative approach is to inject an iFrame into the page and use changes to its src as a messaging channel.

framework.js does all the heavy lifting here, however you need to make sure calls to LoadFrameworkAsync are made as follows on these platforms:

await _Interpreter.LoadFrameworkAsync(WebToHostMessageChannel.IFrame);

By loading the framework in this way, you can communicate again from the website back to the host app via framework.scriptNotify(json).

The HybridWebView Control makes these messages simple to consume via the MessageReceived event.