2015-09-22 25 views
20

Ho un app in cui mi ha colpito un HTTP Request"Questa applicazione non è consentito di interrogare per lo schema di Cydia" errore IOS9

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

Ora, ogni volta che la richiesta di cui sopra è fatta ricevo il seguente errore e nessun dato viene ricevuto nella risposta. Dopo 60 sec ricevo "Time Out error". Sta funzionando bene su IOS8 e sotto, ma non funziona gin IOS9. Qualcuno potrebbe farmi sapere cos'altro ho a che fare con questo problema. Inoltre, ho fatto le seguenti modifiche riguardanti ATS per iOS9 in info.plist, ma ancora affrontando il problema. Per favore fatemi sapere come risolvere questo problema? Grazie in anticipo.

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> 

errore

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

Ho questo problema solo quando eseguo app su emulatore. Lo hai risolto? –

risposta

10

Questo problema si verifica solo in iOS 9 dal momento che Apple ha apportato alcune modifiche che incidono schemi URL.

Penso che una delle vostre librerie sta controllando per vedere se si esegue su un dispositivo jailbroken verificando se può aprire Cydia: // URL ...

"Fino ad iOS 9, applicazioni sono state in grado di chiamare questi metodi su qualsiasi URL arbitrario. A partire da iOS 9, le app dovranno dichiarare quali schemi URL vorrebbero poter controllare e aprire nei file di configurazione dell'app mentre vengono inviate ad Apple "

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

+3

Apple rifiuterà l'invio se "cydia" viene aggiunto alla whitelist nell'app plist? – frankish

+0

@frankish - Apple rifiuterà l'invio se "cydia" viene aggiunto alla whitelist nell'app plist? – Vijay

21

Prima soluzione: - basta aggiungere il codice qui sotto nel vostro info.plist

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

Seconda soluzione: -

qualsiasi applicazione costruita con SDK 9 necessità di fornire una voce LSApplicationQueriesSchemes nel suo file plist, dichiarando che i regimi si tenta di query.

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

Assumendo due app TestA e TestB. TestB vuole interrogare se TestA è installato. "Testa" definisce il seguente schema URL nel suo file info.plist:

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

La seconda app "TestB" cerca di scoprire se "testa" è installato chiamando:

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

Ma questo normalmente restituirà NO in iOS9 perché "TestA" deve essere aggiunto alla voce LSApplicationQueriesSchemes nel file info.plist di TestB. Questo viene fatto aggiungendo il seguente codice in un file di info.plist TestB:

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

Eliminare il quadro Splunk Zecca se lo avete aggiunto al progetto perché Xcode 7 non supporta il quadro.

Inoltre, aggiungi questa chiave al tuo.plist:

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