Jump and communication between two apps in iOS

Source: Internet
Author: User

The jump between apps

A: In the first app first do the following actions;

1. Add an entry under the Information property list in the Info.plist file: URL types.

2. Click on item 0 under URL types, and then click Item 0 To change the URL identifier under item 0 to URL schemes.

3, click on the URL schemes under item 0, add Skipone after it (Skipone for the first app's jump logo, here according to your own writing)

Two: In the second app, add the following code where you need to jump to the first app:

@" skipone:// " ;     * url = [Nsurl urlwithstring:astring];    [[UIApplication Sharedapplication]openurl:url];

Three: Re-run the second app, and trigger the jump to the first app event, to complete the simple app jump between.

Pass-through between apps

One: first to achieve the function of jumping between the previous apps.

Second: The above code needs to be modified slightly.

NSString *astring = @ "skipone://"
In this line of code, add some information after (skipone://)如:
NSString *astring =[nsstring stringWithFormat:@ "skipone://username=%@&age=%@"@ "xiaoxiao"@ "+"];
三:在第一个APP的APPDelegate中
-(BOOL) Application: (UIApplication *) application OpenURL: (nsurl *) URL sourceapplication: (NSString *) sourceapplication annotation: (ID) annotation{    *urlstr = [url absolutestring];    NSLog (@ "%@", urlstr);     return YES;}

This gets the URLSTR string, which needs to handle the string itself according to the required data.



Jump and communication between two apps in iOS

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.