繁体   English   中英

“此应用程序不允许查询方案cydia”IOS9错误

[英]“This app is not allowed to query for scheme cydia” IOS9 error

我有一个应用程序,我点击HTTP请求

<NSURLConnection: 0x12d755110> { request: <NSMutableURLRequest: 0x12d754e10> { URL: http://XX.XX.XX.XXX/webService/dataService.svc/SearchLocation } }

现在,无论何时发出上述请求,我都会收到以下错误,并且响应中没有收到任何数据。 60秒后,我收到“ Time Out error ”。 它在IOS8及以下版本上工作正常,但不适用于IOS9。 谁能让我知道我还有什么办法解决这个问题。 另外,我在info.plist中对iOS9的ATS进行了以下更改,但仍面临此问题。 请让我知道如何解决这个问题? 提前致谢。

的Info.plist

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSIncludesSubdomains</key>
        <true/>
        <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
        <true/>
        <key>NSTemporaryExceptionMinimumTLSVersion</key>
        <string>TLSv1.1</string>
    </dict>

错误

2015-09-22 22:19:58.333 App[751:139449] regionDidChangeAnimated>>>>>>>>>>>>>>>>>: = 40.844278,-74.130561
2015-09-22 22:19:58.344 App[751:139449] Reachability Flag Status: -R ------- networkStatusForFlags
2015-09-22 22:19:58.350 App[751:139449] request:< SearchLocation ><DeviceKeyUDID>My Device UDID</DeviceKeyUDID><SecretKey>SecretKey/SecretKey><ListingType>LOCATION</ListingType><PageIndex>1</PageIndex><MaxNoOfRecords>20</MaxNoOfRecords><Latitude>40.844276</Latitude><Longitude>-74.130562</Longitude><Distance>25</Distance><Address></Address><SearchText></SearchText></SearchLocation >
2015-09-22 22:19:58.357 App[751:139449] -canOpenURL: failed for URL: "cydia://package/com.fake.package" - error: "This app is not allowed to query for scheme cydia"
2015-09-22 22:19:58.945 App[751:139449] theXML contains:
2015-09-22 22:19:58.959 App[751:139449] refreshLocationList maxRecordsSelected:::::::::::::20
2015-09-22 22:19:58.960 App[751:139449] refreshLocationList maxNumOfRecords:::::::::::::20
2015-09-22 22:19:58.960 App[751:139449] refreshLocationList LocationCount::::::::::::::0
2015-09-22 22:19:58.960 App[751:139449] isTempleMaxRecordChanged :::::::::::::0

第一个解决方案: -只需在info.plist中添加波纹管代码即可

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

第二解决方案: -

使用SDK 9构建的任何应用程序都需要在其plist文件中提供LSApplicationQueriesSchemes条目,声明它尝试查询哪些方案。

<key>LSApplicationQueriesSchemes</key>
<array>
 <string>urlscheme</string>
 <string>urlscheme2</string>
 <string>urlscheme3</string>
 <string>urlscheme4</string>
</array> 

假设有两个应用程序TestA和TestB。 TestB想要查询是否安装了TestA。 “TestA”在其info.plist文件中定义了以下URL方案:

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>testA</string>
        </array>
    </dict>
</array>

第二个应用程序“TestB”试图通过调用以确定是否安装了“TestA”:

[[UIApplication sharedApplication]
                    canOpenURL:[NSURL URLWithString:@"TestA://"]];

但这通常会在iOS9中返回NO,因为需要将“TestA”添加到TestB的info.plist文件中的LSApplicationQueriesSchemes条目中。 这是通过将以下代码添加到TestB的info.plist文件来完成的:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>TestA</string>
</array>

此问题仅发生在iOS 9中,因为Apple进行了一些影响URL方案的更改。

我认为你的一个库通过检查它是否可以打开cydia:// URL来检查你是否在越狱设备上运行...

“直到iOS 9,应用程序才能在任意URL上调用这些方法。从iOS 9开始,应用程序必须声明他们希望能够在应用程序的配置文件中检查和打开的URL方案因为它被提交给Apple“

链接: http//awkwardhare.com/post/121196006730/quick-take-on-ios-9-url-scheme-changes

如果您在项目中添加了Splunk Mint框架,则删除Splunk Mint框架,因为Xcode 7不支持该框架。

还要将此密钥添加到.plist中:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM