iOS Question Error: The resource could not be loaded because the App Transport Security policy requires the use o

Marco Maria Vilucchi

Active Member
Licensed User
Longtime User
Hi all,
My app is published on applestore
I have the error in the object on a device with IOS 9.
Other device with IOS 7 works

I read the thread:
https://www.b4x.com/android/forum/threads/ios-9-important-changes.59457/

and I correct my code deleting
#ATSEnabled: True

but I have the error too....
B4X:
#Region  Project Attributes
    #ApplicationLabel: ServiceH24
    #Version: 1.0.2
    'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
    '#iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
    '#iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
    #iPhoneOrientations: Portrait
    #iPadOrientations: Portrait
    #PlistExtra: <key>UIBackgroundModes</key><array><string>location</string></array>
    #PlistExtra:<key>NSLocationWhenInUseUsageDescription</key><string>Used to display the current navigation data.</string>
    #PlistExtra:<key>NSLocationUsageDescription</key><string>Used to display the current navigation data.</string>
    
    #PlistExtra:<key>NSPhotoLibraryUsageDescription</key><string>Select a photo.</string>
    #PlistExtra:<key>NSCameraUsageDescription</key><string>Taking a photo.</string>
    #PlistExtra:<key>NSMicrophoneUsageDescription</key><string>Record video.</string>
    #PlistExtra: <key>UIFileSharingEnabled</key><false/>
    #PlistExtra: <key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/>
    #PlistExtra: <key>NSAllowsArbitraryLoadsInWebContent</key><true/>
    #PlistExtra: </dict>

    #PlistExtra: <key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><false/>
    #PlistExtra: <key>NSExceptionDomains</key><dict>
    'list the excluded domains (example.com and b4x.com)
    #PlistExtra: <key>ftp.mamavisoftware.it</key><dict><key>NSIncludesSubdomains</key><true/><key>NSExceptionAllowsInsecureHTTPLoads</key><true/></dict>
    #PlistExtra: <key>www.mamavisoftware.it</key><dict><key>NSIncludesSubdomains</key><true/><key>NSExceptionAllowsInsecureHTTPLoads</key><true/></dict>
    'end of excluded domains
    #PlistExtra: </dict>
    #PlistExtra: </dict>

    #Entitlement: <key>aps-environment</key><string>production</string>
    #UrlScheme: com.googleusercontent.apps.1055152918548-ri20ulj05pd5si9svif632vv1ltvc54s

' per eseguire il debug usare i seguenti due certificati ed inserire su Project/BuildConfiguration:
'        com.RoraryGourmet.app
'   #ProvisionFile: Development.mobileprovision
'    #CertificateFile: ios_development.cer

' per eseguire il Build Release App usare i seguenti due certificati ed inserire su Project/BuildConfiguration:
    #ProvisionFile: ServiceH24AdHoc.mobileprovision
    #CertificateFile: ios_distribution.cer

' per eseguire il Build Release App con Distribution usare i certificati di Build Release App erendere operative le seguenti istruzioni
'    #If RELEASE
'       #ProvisionFile: ServiceH24Dist.mobileprovision
'       #CertificateFile: ios_distribution.cer
'    #END IF
    
#End Region

What can I do?
Thanks
Marco
 

Marco Maria Vilucchi

Active Member
Licensed User
Longtime User
I solved the issue.
It isn't necessary to set:
#ATSEnabled: False

but it's necessary to set:
#PlistExtra: <key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/>
Thanks all
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…