after project creation, in XCode expand "CordovaLib.xcodeproj" and open "Classes/Cleaver/CDVViewController.m" then edit the code : replace
NSString* startFilePath = [self pathForResource:self.startPage];
by
NSString* startFilePath = self.startPage;
and replace
appURL = [NSURL fileURLWithPath:startFilePath];
by
appURL = [NSURL URLWithString:startFilePath];
You can now open any URL directly from AppDelegate.m
self.viewController.startPage = @"http://www.foodtree.com/m/certifiedhumane";
In CDVViewController.m
else if ([self.whitelist schemeIsAllowed:[url scheme]])
{
NSDictionary *openInSafariSetting = [self.settings objectForKey:@"OpenInSafariList"];
// iterate through settings OpenInSafariList, check for equality
NSEnumerator* enumerator = [openInSafariSetting keyEnumerator];
NSString* urlToOpenInSafari;
while ( urlToOpenInSafari = [enumerator nextObject])
{
if ([[url host] isEqualToString:urlToOpenInSafari] ) {
NSLog(@"URL found in OpenInSafariList: opening in SAFARI");
[[UIApplication sharedApplication] openURL:url];
return NO;
}
}
if ([self.whitelist URLIsAllowed:url] == YES)
{
NSNumber *openAllInWhitelistSetting = [self.settings objectForKey:@"OpenAllWhitelistURLsInWebView"];
if ((nil != openAllInWhitelistSetting) && [openAllInWhitelistSetting boolValue]) {
NSLog(@"OpenAllWhitelistURLsInWebView set: opening in webview");
return YES;
}
// mainDocument will be nil for an iFrame
NSString* mainDocument = [theWebView.request.mainDocumentURL absoluteString];
// anchor target="_blank" - load in Mobile Safari
if (navigationType == UIWebViewNavigationTypeOther && mainDocument != nil)
{
[[UIApplication sharedApplication] openURL:url];
return NO;
}
// other anchor target - load in Cordova webView
else
{
return YES;
}
}
return NO;
}
In Cordova.plist set/create these params
OpenAllWhitelistURLsInWebview Boolean YES
OpenInSafariList Dictionnary
maps.google.com String