The app jumps between each other

Source: Internet
Author: User

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

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.