“这个程序是不允许查询计划cydia”IOS9错误

我有一个应用程序,我打了一个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 

这个问题只发生在iOS 9,因为苹果公司做了一些影响URLscheme的变化。

我认为你的一个库正在检查是否运行在越狱设备上,检查是否可以打开cydia:// URL …

“直到iOS 9,应用程序才能够在任何URL上调用这些方法。从iOS 9开始,应用程序将必须声明他们希望能够检查并在应用程序的configuration文件中打开的URL模式因为它提交给苹果“

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

第一个解决scheme: –在你的info.plist中添加下面的代码

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

第二种解决scheme:

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

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

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

 <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> 

如果您将它添加到项目中,请删除Splunk Mint框架,因为Xcode 7不支持该框架。

还要将这个键添加到你的.plist中:

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