iOS APP之间跳转
a跳转至b
1.配置b
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { NSLog(@"Calling Application Bundle ID: %@", sourceApplication); NSLog(@"URL scheme:%@", [url scheme]); NSLog(@"URL query: %@", [url query]); return YES; }
2.配置a (LSApplicationQueriesSchemes)
//NSString *customURL = @"iOSDevApp://"; NSString *customURL = @"iOSDevApp://?token=123abct®istered=1"; if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:customURL]]) { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:customURL]]; } else { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"URL error" message:[NSString stringWithFormat: @"No custom URL defined for %@", customURL] delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; }
参考网址:http://www.cocoachina.com/industry/20140522/8514.html