Called by:
Just execute the following call method, with "://" As the delimiter, the left is to invoke the app's address, to the right is the parameter you want to pass to the app.
Nsurl *url = [Nsurl urlwithstring:@ "ceshi001://aaaaaaa"]; [[UIApplication sharedapplication] openurl:url];
called by:
Add the URL types property in the Info.plist file as shown in:
and implement the following delegate methods
-(BOOL) Application: (UIApplication *) application OpenURL: (nsurl *) URL sourceapplication: (NSString *) Sourceapplication annotation: (ID) annotation{ nsstring*text=[[url Host] Stringbyreplacingpercentescapesusingencoding:nsutf8stringencoding]; NSLog (@ "%@", text); NSLog (@ "%@", url.description); NSLog (@ "%@", sourceapplication); return YES;}
Print the following information:
015-05-26 15:26:00.821 happtest[5365:1695127] Aaaaaaa
2015-05-26 15:26:00.822 happtest[5365:1695127] Ceshi001://aaaaaaa
2015-05-26 15:26:00.822 happtest[5365:1695127] Com.huaxun.AppTest
IOS App calls each other