Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Detecting if Facebook authorise first time or a subsequent attempt

$
0
0

Hi all,

Ti SDK 3.3, iOS 7

Trying to get my head round the Facebook implementation and integration with ACS

I'm able to authorise a facebook login and also create an ACS account. However, how do I tell if a user logs out of both ACS and Facebook and then logs back in?

exports.fbcreate = function fbcreate(accesstoken, callback) {
    var Cloud = require("ti.cloud");
    Cloud.SocialIntegrations.externalAccountLogin({
        type : "facebook",
        token : accesstoken
    }, function(e) {
        if (e.success) {
            var sID = Cloud.sessionId;
            var user = e.users[0];
            Ti.App.Properties.setString("sessionID", sID);
            Ti.App.Properties.setString("userID", user.id);
            callback(false, sID);
        } else {
            callback(true, e.message);
        };
    });
};
How can I tell if the user account already exists or whether one was created?

Thanks


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>