ios.plistInject=<key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/></dict>
Everything works fine and I can make the connection. But obviously I don't want to do this. I am trying to make a local connection from an iOS device to my PC over my home network. Apple recognize this condition, I think, NSAllowsLocalNetworking. From the Apple article you reference:
An optional Boolean value that, when set to
YES, removes App Transport Security protections for connections to unqualified domains and to.localdomains, without disabling ATS for the rest of your app.If you set this key’s value to
YES, then App Transport Security ignores the value of theNSAllowsArbitraryLoadskey in iOS 10 and later and in macOS 10.12 and later. This behavior supports adoption of App Transport Security protections while allowing embedded browsers to continue working in iOS 9 and earlier and in OS X v10.11 and earlier. (To obtain this behavior, set the value of this key toYESand set the value of theNSAllowsArbitraryLoadskey toYESas well.)Default value is
NO.Available starting in iOS 10.0 and macOS 10.12.
If I read this correctly I have to set both NSAllowsArbitraryLoads and NSAllowsLocalNetworking to true. And therein lies my problem, whatever I do results in a build failure on the plist step. I have no idea how to format the plist entry.
I have tried things like:
<key>NSAppTransportSecurity</key><dict><key>NSAllowsLocalNetworking</key><true/></key><key>NSAllowsArbitraryLoads</key><true/></dict>
<key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/></dict><dict><key>NSAllowsLocalNetworking</key><true/></dict>
but the build always fails. I obviously have no idea what I am doing here. How do I format the plist entry?
Thanks
ios.plistInject=<key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/><key>NSAllowsLocalNetworking</key><true/></dict>