The first time to write a blog, to bring you: iOS development in the different apps between the jump, I believe that many people have also been useful friends of the Alliance SDK or other third-party sharing tools, the principle is the same.
The implementation of the jump is divided into four steps:
Step one: Build two projects that mimic the environment of two apps
Step two: Set the URL of application two in the second project
Step three: Write a UIButton in the first project, and the button method is as follows:
Note that the AppID is added ":"
Fourth step: Run two projects separately, build the app, then open the first project, we click button, we will find the second project jumped.
Open the second page we should have the following two points of attention:
1th:
1. If the second app does not start, a second app is launched and the method in the second project is called:
-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchOptions {
Override point for customization after application launch.
return YES;
}
2. If the second program starts and runs in the background, this method is not called
2nd: We can pass parameters in one way:
This method is called when an application is opened by another program, where the data transfer between the two applications can be implemented
-(BOOL) Application: (UIApplication *) application OpenURL: (nsurl *) URL sourceapplication: (NSString *) sourceapplication annotation: (id) annotation
{
NSLog (@ "%@", url);
NSLog (@ "%@", sourceapplication);
return YES;
}
The app jumps between each other