0

I have an ionic v2.1 application that works when I develop locally in browser, but when I build the ios project and simulate it on the ipad in xcode, I have trouble making https calls to my django app using django rest framework.

I did test to make sure I could make http calls to an arbitrary endpoint and I tested my endpoint with curl and other methods so I know my service is up. I have also tried stuff in this post: CFNetwork SSLHandshake failed iOS 9 trying to update the .plist file.

$scope.buttonPress = function(){

   // this one works - some random endpoint
   $http.get('https://jsonplaceholder.typicode.com/posts/1').then(function(data){
     console.log(data.data);
   }).catch(function(err){
     console.log('some err getting json placeholder');
   });

   // mine does not work in xcode, it just prints the .catch console.log in
   // xcode console. this endpoint works any other time i try it accept
   // through xcode.
   $http.get('https://mycoolapp.menu/getBartenderInfo/').then(function(data){
     console.log(data.data);
   }).catch(function(err){
     console.log('some err getting the info');
   });

}

Updating the .plist to allow for arbritary or doing something like this:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
       <key>mycoolapp.menu</key>
       <dict>
           <key>NSIncludesSubdomains</key>
           <true/>
           <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
           <true/>
           <key>NSTemporaryExceptionMinimumTLSVersion</key>
           <string>TLSv1.0</string>
           <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
           <false/>
       </dict>
   </dict>

has not worked.

Any help would be appreciated. If I left anything critical out of the problem statement, please let me know.

Community
  • 1
  • 1
Steven Simoni
  • 97
  • 1
  • 7

1 Answers1

0

Found the answer here for anyone using ionic and cdvwkewebview.

https://forum.ionicframework.com/t/ios10-http-requests-blocked/67663

Steven Simoni
  • 97
  • 1
  • 7