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