问题
I use openURL to open app B from App A, and I get this alert dialog "App A wants to open App B", with two buttons, "Open" and "Cancel".
If I press "Cancel", app B won't open and dialog will appear again.
If I press "Open", app B will open and dialog won't appear again.
I would like to somehow to make it not appear to begin with. I am wondering if there is a key I should add to app A's info.plist in order to skip the dialog step when doing openURL to app B.
Any ideas?
Update:
After checking, I could not come up with a solution for my problem. It looks like this dialog will appear regardless. I hope Apple will add the option to handle it automatically as if both apps are mine, logically, there should not be any dialog to confirm switching between them...
回答1:
After checking for hours, I could not come up with a solution for my problem. It looks like this dialog will appear regardless anything... I hope Apple will add the option to handle it in the app's info.plist as if both apps are mine, logically, there should not be any dialog to confirm switching between them...
回答2:
http://www.macstories.net/linked/ios-9-bringing-changes-to-url-schemes/
Starting on iOS 9, apps will have to declare what URL schemes they would like to be able to check for and open in the configuration files of the app as it is submitted to Apple. This is essentially a whitelist that can only be changed or added to by submitting an update to Apple.
openURL / canOpenURL has changed in iOS9 due to user privacy. I suggest you read http://awkwardhare.com/post/121196006730/quick-take-on-ios-9-url-scheme-changes
The user will now see this prompt the first time you ask for permission as per other permission requests. This is an OS change and apps, including core applications such as messages now ask for permission when opening a custom URL scheme for the first time.
You also may be able to achieve what you are trying to do using Universal Links - https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12
来源:https://stackoverflow.com/questions/32312009/how-to-avoid-wants-to-open-dialog-triggered-by-openurl-in-ios-9-0