Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Commit

Permalink
Fix compilation errors caused by the introduction of pluggable WebVie…
Browse files Browse the repository at this point in the history
…ws in cordova-ios@4.0 - Note that the current fix does not support anything but UIWebView
  • Loading branch information
f2bo committed Jun 2, 2016
1 parent ab5d75c commit 61045c7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ios/CDVHostedWebApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ - (void)pluginInitialize

// set the webview delegate to notify navigation events
notificationDelegate = [[CVDWebViewNotificationDelegate alloc] init];
notificationDelegate.wrappedDelegate = self.webView.delegate;
[self.webView setDelegate:notificationDelegate];
notificationDelegate.wrappedDelegate = ((UIWebView*)self.webView).delegate;
[(UIWebView*)self.webView setDelegate:notificationDelegate];

id offlineFeature = [manifest objectForKey:@"mjs_offline_feature"];
if (offlineFeature != nil && [offlineFeature boolValue] == NO) {
Expand Down Expand Up @@ -221,7 +221,7 @@ -(BOOL) injectScripts:(NSArray *)scriptList {
}
}

return[self.webView stringByEvaluatingJavaScriptFromString:content] != nil;
return[(UIWebView*)self.webView stringByEvaluatingJavaScriptFromString:content] != nil;
}

- (BOOL) isCordovaEnabled
Expand Down Expand Up @@ -304,7 +304,7 @@ -(BOOL) isMatchingRuleForPage:(NSDictionary*) rule withPlatformCheck: (BOOL) che
if (match != nil)
{
CDVWhitelist *whitelist = [[CDVWhitelist alloc] initWithArray:match];
NSURL* url = self.webView.request.URL;
NSURL* url = ((UIWebView*)self.webView).request.URL;
isURLMatch = [whitelist URLIsAllowed:url];
}
}
Expand Down Expand Up @@ -361,7 +361,7 @@ - (void)updateConnectivityStatus:(NSNotification*)notification
}
else {
if (self.failedURL) {
[self.webView loadRequest: [NSURLRequest requestWithURL: self.failedURL]];
[(UIWebView*)self.webView loadRequest: [NSURLRequest requestWithURL: self.failedURL]];
}
else {
[self.offlineView setHidden:YES];
Expand Down Expand Up @@ -417,7 +417,7 @@ - (void)webViewDidFinishLoad:(NSNotification*)notification
}

NSString* javascript = [NSString stringWithFormat:@"window.hostedWebApp = { 'platform': '%@', 'pluginMode': '%@', 'cordovaBaseUrl': '%@'};", IOS_PLATFORM, pluginMode, cordovaBaseUrl];
[self.webView stringByEvaluatingJavaScriptFromString:javascript];
[(UIWebView*)self.webView stringByEvaluatingJavaScriptFromString:javascript];

NSMutableArray* scripts = [[NSMutableArray alloc] init];
if ([pluginMode isEqualToString:@"client"])
Expand Down

0 comments on commit 61045c7

Please sign in to comment.