3 ms·
Call ObjectiveC methods from Javascript in a UIWebView
- DenisM 15y agoHere's the relevant part: https://github.com/marcuswestin/WebViewJavascriptBridge/blob/master/WebViewJavascriptBridge/Classes/WebViewJavascriptBridge.m https://github.com/marcuswestin/WebViewJavascriptBridge/blob...
- buddydvd 15y agoVery similar code exists within PhoneGap. In addition to bi-directional message passing, PhoneGap also provides: 1.) JSON serialization/deserialization, 2.) callback tracking, and 3.) white-listing of domains that may pass messages to the host. https://github.com/phonegap/phonegap-iphone https://github.com/phonegap/phonegap-iphone
- DenisM 15y agoAny thoughts on using local XMLHttpRequest instead of the more usual frame reload method?
- marcuswestin 15y agoGreat idea! Sounds cleaner but I think it'd be more code injected into the webview than the current approach.