The jump between apps
A: In the first app first do the following actions;
1. Add an entry under the Information property list in the Info.plist file: URL types.
2. Click on item 0 under URL types, and then click Item 0 To change the URL identifier under item 0 to URL schemes.
3, click on the URL schemes under item 0, add Skipone after it (Skipone for the first app's jump logo, here according to your own writing)
Two: In the second app, add the following code where you need to jump to the first app:
@" skipone:// " ; * url = [Nsurl urlwithstring:astring]; [[UIApplication Sharedapplication]openurl:url];
Three: Re-run the second app, and trigger the jump to the first app event, to complete the simple app jump between.
Pass-through between apps
One: first to achieve the function of jumping between the previous apps.
Second: The above code needs to be modified slightly.
NSString *astring = @ "skipone://"
In this line of code, add some information after (skipone://)如:
NSString *astring =[nsstring stringWithFormat:@ "skipone://username=%@&age=%@"@ "xiaoxiao"@ "+"];
三:在第一个APP的APPDelegate中
-(BOOL) Application: (UIApplication *) application OpenURL: (nsurl *) URL sourceapplication: (NSString *) sourceapplication annotation: (ID) annotation{ *urlstr = [url absolutestring]; NSLog (@ "%@", urlstr); return YES;}
This gets the URLSTR string, which needs to handle the string itself according to the required data.
Jump and communication between two apps in iOS