Ich habe ein seltsames Problem, Ich bekomme immer App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
, aber ich habe eine Ausnahme aktiviert, sowie das Öffnen der gesamten App für ATS, aber meine Präferenz wird von Xcode ignoriert, obwohl meine anderen Schlüssel verwendet werden.ATS-Warnung aber temporäre Ausnahme aktiv?
Ich frage mich, was ich falsch mache, kann mir jemand sagen, wenn etwas sie als sehr falsch in meinen Schlüsseln schlägt?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AUTH_SERVER_URL</key>
<string>https://$(Auth_Server_Url)</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>MKDirectionsRequest</string>
<key>LSItemContentTypes</key>
<array>
<string>com.apple.maps.directionsrequest</string>
</array>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>fr.cityzenmobility.drivers</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>6</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MKDirectionsApplicationSupportedModes</key>
<array>
<string>MKDirectionsModeCar</string>
<string>MKDirectionsModeStreetCar</string>
<string>MKDirectionsModeTaxi</string>
</array>
Hier ist der Teil, der funktionieren sollte:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSExceptionDomains</key>
<dict>
<key>www.mysite.fr</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
Dann wird das Ende der Info.plist Datei:
<key>SERVERURL</key>
<string>http://${Server_Url}</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Welcome</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</dict>
</plist>
EDIT
Ich habe baute ein brandneues Projekt, mit dem genau dieselbe Info.plist. Es funktioniert, fortan ist das Problem nicht mit dem Netzwerkteil selbst.
Sieht aus wie der Wert für 'NSThirdPartyException ...' Schlüssel ist eine leere Zeichenfolge statt 'true' – dan
@ Dan Gut erkannt, aber leider hat es nicht behebe das Problem. Ich denke, ich werde ein brandneues Projekt machen, nur um das auszuprobieren ... – Kheldar
Ich habe das gerade entdeckt https://developer.apple.com/library/ios/qa/qa1887/_index.html#//apple_ref/ doc/uid/DTS40015177, die mit dieser Art von Problem hoffentlich hilft. – Kheldar