Re: Simple iOS App with Foundation InputStream and OutputStream...


listservices@...
 

Hi Brandon.
 
One other consideration with iOS is that you may need to whitelist the destinations you want to connect to by declaring them in your info.plist under the NSAppTransportSecurity key. I don’t know if this applies to streams or not(?). 
 
In any event, this is done in your app's info.plist. Here is some sample XML with some different options you might need. I’ve added some explanatory comments. For the official guide, go here:
 
 
and search for NSAppTransportSecurity on the page.
 
 
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key> // As you might expect, this lets you load from arbitrary locations which can be useful during development
<true/>
<key>NSExceptionDomains</key>. // The domains you are going to whitelist go here
<dict>
<key>akamaihd.net</key> // The domain (or subdomain) you want to whitelist.
<dict>
<key>NSIncludesSubdomains</key> // In this case, any akamaihd.net subdomain is allowed. 
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key> 
<false/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key> // This allows non https loads, which are blocked by default.
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
 
Hopefully this is helpful.
 
— Erikheath

Join {cocoa@apple-dev.groups.io to automatically receive all group messages.