Vote count:
0
We have this code in viewDidLoad
self.context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
self.context[@"Mobile"] = [WebViewJavascriptInterface class];
And our class methods from WebViewJavascriptInterface are exposed to our first web page.
When the user navigates to another page, these methods are no longer available. The "Mobile" object is not present.
Is this because the page changed? Where should I be placing this code, or what other code do I need to be put in place? We want these methods/Mobile object available in the web frame for all of the pages.
asked 1 min ago
JavaScriptCore object getting lost
Aucun commentaire:
Enregistrer un commentaire