Jump between IOS Apps

Source: Internet
Author: User

Jump from one appclient to another appserver, where the appclient appserver knowledge represents two different apps and does not have bunldid functionality. I got the wrong idea at first.

The implementation jumps from Appclient to another appserver:

1. First add a line attribute to AppServer's info.plist.

The URL is composed of: Pupuwang://com.pupuwang.xwcustomer

Where URL schemes is most important, is the prefix of the URL, url identifier is URL://String after

2. In AppServer's uiapplication agent, the implementation

-(BOOL) Application: (UIApplication *) application OpenURL: (nsurl *) URL sourceapplication: (NSString *) sourceapplication annotation: (ID) annotation{    if ([[url absolutestring] Iscontainsubstring:@ "com.pupuwang.XWCustomer"]) {        return  YES;    }     return NO;}

3. In the Appclient

Nsurl *url = [Nsurl urlwithstring:@"Pupuwang://com.pupuwang.xwcustomer"];//URL pattern: appserver URL schemes://url identifierbool hasinstagram=[[UIApplication sharedapplication] canopenurl:url];if(hasinstagram) {//Jump[[UIApplication sharedapplication] openurl:url];}Else{    //Download to AppStore//nsstring *url = [NSString stringwithformat:@]https://itunes.apple.com/cn/app/id%@ ", xw_b_appid];NSString *url = [NSString stringWithFormat:@"https://itunes.apple.com/"]; UIApplication* Application =[UIApplication sharedapplication]; //Download the Merchant edition to the store[Application Openurl:[nsurl urlwithstring:url];}

and implement UIApplication's agent

-(BOOL) Application: (UIApplication *) application Handleopenurl: (Nsurl *) url{    return  YES;

You can jump from appclient to AppServer

Jump between IOS Apps

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.