关于 iOS 9 之后 canOpenURL 的返回值
官方文档: 点击此处
IMPORTANT
If your app is linked on or after iOS 9.0, you must declare the URL schemes you want to pass to this method. Do this by using the LSApplicationQueriesSchemes array in your Xcode project’s Info.plist file. For each URL scheme you want your app to use with this method, add it as a string in this array.
If your (iOS 9.0 or later) app calls this method using a scheme you have not declared, the method returns NO, whether or not an appropriate app for the scheme is installed on the device.
Discussion
If your app is linked against an earlier version of iOS but is running in iOS 9.0 or later, you can call this method on 50 distinct URL schemes. After hitting this limit, subsequent calls to this method return NO. If a user reinstalls or upgrades the app, iOS resets the limit.
Unlike this method, the openURL: method is not constrained by the LSApplicationQueriesSchemes requirement: If an app that handles a scheme is installed on the device, the openURL: method works, whether or not you have declared the scheme.
Tips
从官方文档可知,iOS9之后对canOpenURL方法做了一些约束(目的应该是保护用户隐私);必须将URL scheme在Info.plist中作相关声明,此方法才会有效,否则无论目标APP安装与否,canOpenURL都返回NO。