我有一个应用程序,我点击了一个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的自动测试系统做了以下更改,但仍然面临这个问题。请让我知道如何解决这个问题?提前谢谢。
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发布于 2015-10-01 01:00:15
这个问题只发生在iOS 9中,因为苹果做了一些改变,影响了网址方案。
我认为你的一个库正在检查你是否正在越狱设备上运行,方法是检查它是否可以打开cydia://URL...
“在iOS 9之前,应用程序可以在任意URL上调用这些方法。从iOS 9开始,应用程序必须声明它们希望能够在提交给苹果的应用程序的配置文件中检查和打开的URL方案。”
链接:http://awkwardhare.com/post/121196006730/quick-take-on-ios-9-url-scheme-changes
发布于 2015-10-27 17:32:57
第一个解决方案:-只需在你的info.plist中添加下面的代码
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>第二个解决方案:-
任何使用SDK9构建的应用程序都需要在其plist文件中提供一个LSApplicationQueriesSchemes条目,声明它试图查询哪些方案。
<key>LSApplicationQueriesSchemes</key>
<array>
<string>urlscheme</string>
<string>urlscheme2</string>
<string>urlscheme3</string>
<string>urlscheme4</string>
</array> 假设有两个应用程序TestA和TestB。TestB想要查询是否安装了TestA。“URL”在其info.plist文件中定义了以下TestA方案:
<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>发布于 2017-01-23 23:17:35
如果您在项目中添加了Splunk Mint框架,请将其删除,因为Xcode7不支持该框架。
还要将此密钥添加到您的.plist中:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>https://stackoverflow.com/questions/32722638
复制相似问题