NSString* jsString = [NSString stringWithFormat:@"alert('ok');"];[self.viewController.webView stringByEvaluatingJavaScriptFromString:jsString];
I wrote it in cordova appdelegate.m!
NSString* jsString = [NSString stringWithFormat:@"alert('ok');"];[self.viewController.webView stringByEvaluatingJavaScriptFromString:jsString];
I wrote it in cordova appdelegate.m!
On [email protected] you should be able to do:
[self.webView stringByEvaluatingJavaScriptFromString:jsString];
On cordova-ios@4+ you will need to cast the Webview class as it also supports WKWebView:
if ([self.webView isKindOfClass:[UIWebView class]]) {
[(UIWebView*)self.webView stringByEvaluatingJavaScriptFromString:jsString];
}