0

My code is like this:

var Cloud = require("ti.cloud");

var token = Ti.Facebook.accessToken;

Ti.API.info("CLOUD EXTERNAL ACCOUNT LOGIN");

Ti.API.info("*** fb accessToken: "+token);

Cloud.SocialIntegrations.externalAccountLogin({
    type: 'facebook',
    token: token
}, function (e) {
    if (e.success) {
    }
    else {
        alert('Facebook login error: \n'+ ((e.error && e.message) || JSON.stringify(e)));
    }
}); 

I get the following errors in info

[INFO] :   CFNetwork SSLHandshake failed (-9824)
[INFO] :   CFNetwork SSLHandshake failed (-9824)
[INFO] :   CFNetwork SSLHandshake failed (-9802)
[INFO] :   CFNetwork SSLHandshake failed (-9802)
[INFO] :   NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

And the alert dialog says:

JSON parse error: Unexpected identifier "Ett"

Anyone have any idea what may be causing this?

Fokke Zandbergen
  • 3,866
  • 1
  • 11
  • 28
Emil
  • 137
  • 1
  • 10
  • So just to cover the bases, you've enabled cloud services and other calls to the cloud module are working? – Bert G. Apr 19 '16 at 10:31
  • Yes it should be enabled... I get the same error no matter which method i call on Cloud however, so something seems to be fishy... – Emil Apr 19 '16 at 10:58

1 Answers1

1

This sorted out to be the same problem posted here: Appcelerator login API getting error in response Unexpected identifier

Basically it probably has to do with iOS 9 and the SSL on the appcelerator servers for Cloud. Adding exceptions for them into the info.plist in your tiap.xml will solve the problem.

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSExceptionDomains</key>
  <dict>
    <key>appcelerator.com</key>
    <dict>
        <key>NSIncludesSubdomains</key>
        <true/>
        <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
        <true/>
        <key>NSTemporaryExceptionMinimumTLSVersion</key>
        <string>1.0</string>
        <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
        <false/>
    </dict>
  </dict>
Community
  • 1
  • 1
Emil
  • 137
  • 1
  • 10