Description: This article describes how the app opens another app and delivers data.
One, simple explanation
New two applications, respectively applying a and applying B.
Implementation requirements: Click on the corresponding button in the Appa page to open APPB this application.
1. New two applications, A and B respectively.
142354418874108[1].png
150002248248878[1].png
2. Set the URL to apply B.
150005160123679[1].png
3. Write the code to open the app in application a
150007446066083[1].png
After clicking, you will jump to the new controller.
Note: In the process of opening application B, there are two states of B.
The first state: B does not start, then the B is started. and call the following method.
150006209342745[1].png
The second state: At this point, B is already started, but runs in the background, this time does not call the method.
II: Description
If an application is opened by another application, the following proxy method is invoked, and the method enables the transfer of data between the two applications.
150022244969072[1].png
Code Description:
#import "YYAppDelegate.h"
@implementation yyappdelegate
-(BOOL) Application: (UIApplication *) application Didfinishlaunchingwithoptions: (nsdictionary *) launchoptions
{
NSLog (@ "Didfinishlaunchingwithoptions---B ");
Return YES
}
This method is invoked when an application is opened by another program, where the data transfer between two applications can be implemented
-(BOOL) Application: (UIApplication *) application OpenURL: ( Nsurl *) URL sourceapplication: (NSString *) sourceapplication annotation: (id) annotation
{
NSLog (@ "%@", url);
NSLog (@ "%@", sourceapplication);
Return YES
}
Text/Left hand (Jane book author)
Original link: http://www.jianshu.com/p/2ef7ab4826cf
Copyright belongs to the author, reproduced please contact the author to obtain authorization, and labeled "Jane book author."
The above is the iOS application between the jump and data transfer information collation, follow-up continue to supplement the relevant information, thank you for your support of this site!