IOS10 after OpenURL: Alternative method after expiration of method and its use

Source: Internet
Author: User

At present, Apple has opened a key:uiapplicationopenurloptionuniversallinksonly for iOS10, but the pro-test is invalid.

This key:uiapplicationopenurloptionssourceapplicationkey is currently used.

After iOS10, Canurl and OpenURL merge one can realize dynamic jump without configuration

IOS10 after OpenURL: Method expires,

The new method is as follows:

Options:@{uiapplicationopenurloptionssourceapplicationkey: @YES}//parameter is a dictionary

[[UIApplication Sharedapplication]openurl:[nsurl Urlwithstring:url] options:@{ Uiapplicationopenurloptionssourceapplicationkey: @YES} completionhandler:^ (BOOL success) {

Post-Success Callbacks

if (!success) {

Callbacks after a failure

}

}];

Demo

[[UIApplication Sharedapplication]openurl:[nsurl Urlwithstring:url] options:@{ Uiapplicationopenurloptionssourceapplicationkey: @YES} completionhandler:^ (BOOL success) {

if (!success) {

Uialertcontroller *aler = [Uialertcontroller alertcontrollerwithtitle:@ "Cannot complete jump" message:@ "Please make sure the app is installed" Preferredstyle : Uialertcontrollerstylealert];

Uialertaction *cancelaction = [uialertaction actionwithtitle:@ "OK" style:uialertactionstylecancel Handler:nil];

[Aler addaction:cancelaction];

[Self Presentviewcontroller:aler animated:yes completion:nil];

}else if (back) {

[Self dismissviewcontrolleranimated:yes completion:nil];

}

}];

IOS10 after OpenURL: Alternative method after expiration of method and its use

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.