app之间传递参数

1.添加被传入参数的app的白名单 如:test

2.NSString*Str = [NSStringstringWithFormat:@"text1://name=@"lili"&password=@"123""];

NSURL*url = [NSURLURLWithString:Str];

if([[UIApplicationsharedApplication]canOpenURL:url])

{

     [[UIApplicationsharedApplication]openURL:url];

}

else

{

NSLog(@"未安装app,请先下下载安装app");

}

ps://后面的就是传入的参数

3.在接收参数的Delegate中加入

- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation

{

if(url ==nil){}

else{ NSString*Str = [url absoluteString];//收到的参数  }

returnYES;

}

你可能感兴趣的:(app之间传递参数)