CB-10040 - re-fix: backwards compatible with cordova-ios < 4.0

This commit is contained in:
Shazron Abdullah 2015-11-20 10:53:36 -08:00
parent 9b576f303b
commit 542536f790

View File

@ -231,11 +231,18 @@
- (void)openInCordovaWebView:(NSURL*)url withOptions:(NSString*)options
{
NSURLRequest* request = [NSURLRequest requestWithURL:url];
NSURLRequest* request = [NSURLRequest requestWithURL:url];
#ifdef __CORDOVA_4_0_0
[self.webViewEngine loadRequest:request];
// the webview engine itself will filter for this according to <allow-navigation> policy
// in config.xml for cordova-ios-4.0
[self.webViewEngine loadRequest:request];
#else
if ([self.commandDelegate URLIsWhitelisted:url]) {
[self.webView loadRequest:request];
} else { // this assumes the InAppBrowser can be excepted from the white-list
[self openInInAppBrowser:url withOptions:options];
}
#endif
}