Jump and data transfer between IOS applications _ios

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.