iOS Development outreach-jump and data transfer between apps
Description: This article describes how the app can open another app and pass data.
A simple explanation
Create a new two apps for app A and app B, respectively.
Implementation requirements: Click the corresponding button on the Appa page to open the APPB application.
1. Create a new two apps, A and B, respectively.
2. Set the URL of app B.
3. Write code to open the app in app a
Once clicked, it jumps to the new controller.
Note: B has two states in the process of opening app B.
The first state: B does not start, then B is started. and call the following method.
Second state: At this point, B is started, but it is running in the background, this time it is not called.
II: Description
If an application is opened by another application, the following proxy method is invoked, and the data transfer between the two applications can be implemented in this method.
Code Description:
1 #import "YYAppDelegate.h" 2 3 @implementation yyappdelegate 4 5-(BOOL) Application: (UIApplication *) Application didfinishlaunchingwithoptions: (Nsdictionary *) launchoptions 6 {7 NSLog (@ " Didfinishlaunchingwithoptions---B "); 8 return YES; 9}10 11//When an application is opened by another program, this method is called, in which the data between two applications can be implemented by the Bureau (BOOL) application: (UIApplication *) Application OpenURL: (nsurl *) URL sourceapplication: (NSString *) sourceapplication annotation: (id) annotation13 {14 NSLog (@ "%@", url); NSLog (@ "%@", sourceapplication); return yes;17}
iOS Development outreach-jump and data transfer between apps