handle app store urls in system browser

This commit is contained in:
PC Dreams (Paulo Cristo) 2016-01-05 12:32:47 +00:00
parent 9540f11fcc
commit fa7c46a316

View File

@ -390,7 +390,14 @@
[self.commandDelegate sendPluginResult:pluginResult callbackId:scriptCallbackId]; [self.commandDelegate sendPluginResult:pluginResult callbackId:scriptCallbackId];
return NO; return NO;
} }
} else if ((self.callbackId != nil) && isTopLevelNavigation) { }
//if is an app store link, let the system handle it, otherwise it fails to load it
else if ([[ url scheme] isEqualToString:@"itms-appss"] || [[ url scheme] isEqualToString:@"itms-apps"]) {
[theWebView stopLoading];
[self openInSystem:url];
return NO;
}
else if ((self.callbackId != nil) && isTopLevelNavigation) {
// Send a loadstart event for each top-level navigation (includes redirects). // Send a loadstart event for each top-level navigation (includes redirects).
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
messageAsDictionary:@{@"type":@"loadstart", @"url":[url absoluteString]}]; messageAsDictionary:@{@"type":@"loadstart", @"url":[url absoluteString]}];