- 两个APP之间理论上可以通过URL Scheme 传简单的参数值, 例如:APP_1的URL Scheme为APP_1_URL, APP_2的URL Scheme为APP_2_URL, 从APP_1 跳转 APP_2, 并传值title=test, 通过APP_1中的openURL跳转到APP_2.
APP_1:
NSString *urlStr = [NSString stringWithFormat:@"%@://title=test", APP_2_URL];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr] options:nil completionHandler:^(BOOL success) {}];
APP_2:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
// 此处url的值就是APP_1 openURL的url
NSString *paraStr = url.absoluteString;
}
备注:
添加白名单
屏幕快照 2017-05-11 09.20.03.png添加URL Scheme
屏幕快照 2017-05-11 09.20.54.png
网友评论