I have an application that loads a website into a uiwebview component . I need to communicate between uiwebview and web loading and vice versa.
My application works fine in earlier versions of ios (e.g. ios 7.x, 6.x and 5.x), but now I tried with ios 8 and it does not work. I can send information from object c to javascript (using stringByEvaluatingJavaScriptFromString :), but I can not get information from javascript.
To do this, I used the same thing as here: ios passes the values to my own application . I mean, I implement:
- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
NSLog(@"URL: %@", [request URL]);
NSURL *URL = [request URL];
if ([[URL scheme] isEqualToString:@"newprotocol"]) {
return NO;
}
return YES;
}
When I send: newprotocol: // xxxxx, I always get around: blank
, UIWebView ios 8, .
, ios 8? ?
!