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