从 https://doc.open.alipay.com/doc2/detail?treeId=54&articleId=103419&docType=1 运行 AlipaySDK
演示时,发生了一些奇怪的事情。
从xcode中的日志输出来看,有10多条日志要说
-canOpenURL: failed for URL: "momochs://" - error: "This app is not allowed to query for scheme momochs
demo中没有源码可以通过简单的搜索打印出来。并且静态库只是付款,根据我的理解不应该做这样的检查。
这里的问题是弄清楚为什么会发生这种情况,或者演示或其他设置有什么问题?
2016-03-02 15:58:55.998 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "momochs://" - error: "This app is not allowed to query for scheme momochs" 2016-03-02 15:58:55.999 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "tenpay://" - error: "This app is not allowed to query for scheme tenpay" 2016-03-02 15:58:55.999 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "com.icbc.iphoneclient://" - error: "This app is not allowed to query for scheme com.icbc.iphoneclient" 2016-03-02 15:58:56.000 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "wx2654d9155d70a468://" - error: "This app is not allowed to query for scheme wx2654d9155d70a468" 2016-03-02 15:58:56.000 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "meituan0000://" - error: "This app is not allowed to query for scheme meituan0000" 2016-03-02 15:58:56.000 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "sinaweibo://" - error: "This app is not allowed to query for scheme sinaweibo" 2016-03-02 15:58:56.001 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "dianping://" - error: "This app is not allowed to query for scheme dianping" 2016-03-02 15:58:56.001 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "diditaxi://" - error: "This app is not allowed to query for scheme diditaxi" 2016-03-02 15:58:56.002 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "cn.12306://" - error: "This app is not allowed to query for scheme cn.12306" 2016-03-02 15:58:56.002 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "mtxx://" - error: "This app is not allowed to query for scheme mtxx" 2016-03-02 15:58:56.002 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "youku://" - error: "This app is not allowed to query for scheme youku" 2016-03-02 15:58:56.003 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "baidumap://" - error: "This app is not allowed to query for scheme baidumap" 2016-03-02 15:58:56.003 AliSDKDemo[4491:1610409] -canOpenURL: failed for URL: "iosamap://" - error: "This app is not allowed to query for scheme iosamap"
Why so many canOpenURL ?
因为他们想知道安装了哪些应用程序,直到 iOS8 这是一个很难知道你安装了哪些应用程序的技巧,他们基本上有一个他们想知道的应用程序方案列表,所以他们会连续 canOpenURL
调用每个应用方案,然后收集数据并将其发送回他们的服务器以用于他们需要的任何目的。
谢天谢地,这在 iOS9 中不再允许,因为您需要提供您的应用将执行 canOpenURL
调用的方案列表,调用不在您的 info.plist 中的 url 方案
将导致您看到该日志警告
The odd thing is I got log information as below, but can't find any source code to print out such things.
我看到的 SDK 不是开源的,所以你无法查看他们的代码,代码在静态库 *.a
文件中
Just wonder how can they do this without source code ? Any technology to >achieve this ? thanks
没什么特别的,如果你编写一个项目并将其构建为一个静态库,你将在 .a
文件中获得编译后的源代码,你可以将其导入其他项目并在那里使用,如只要你有正确的头文件,支付宝就是这样做的
希望这可以消除困惑,我建议保持原样,不要让他们完成这样的特技。
你总是可以将这些方案的列表添加到你的 info.plist
中,但是你必须向苹果自己解释为什么你需要打开这么多应用程序,这又是一个非常糟糕的主意,只需忽略它,您就可以开始了!
关于ios - 为什么会有这么多canOpenURL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35741601/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |