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

Cloud externalAccountLink is not working

$
0
0

Facebook login works fine but if a user logs in without Facebook first and then links account with externalAccountLink it does not work. Actually the console.out output looks fine, there is a Facebook external account id, but when I look into the user data on server by using app management the entry is missing. When I try to search for Facebook friends I am getting an error that the account is not authorized for Facebook.

What am I doing wrong? I am using SDK 3.5.1.

Alex

externalAccountLink({
        type: 'facebook',
        token: facebook.accessToken,
    }, function (e) {
        if (e.success) {
            var user = e.users[0];
            console.log("accountlink successful. user data:"+JSON.stringify(user));
        } else {
            console.log("accountlink not successful");
        }
    });         
};
 
 
var userData = {
    username: "test",
    password: "test",
    password_confirmation: "test"
};              
Cloud.Users.create(userData, function (e) {
    if (e.success) {
        console.log('registration successful');
        var user = e.users[0];
        facebook.addEventListener('login', onFacebookLogin);
        facebook.authorize();
    } else {
        console.log('registration not successful');
    }
});
console:
- [INFO] :   registration successful
- [INFO] :   accountlink successful. user data:{"id":"550bd30a7eead2057e87576b","created_at":"2015-03-20T07:58:02+0000","updated_at":"2015-03-20T07:58:02+0000","external_accounts":[{"external_id":"10203290489877651","external_type":"facebook","token":"CAAUrUQLp8NsBAAVyNFSUKPy3UZB4JToqdwQGLupFxZCRPmY9oDKhVFKiR3B6hhghGslPMC7z5L0FDGaW6bbtSAl6SMThfAEXCs83IvcfV0ouMw5DpaSfhhjZCzxiB6CE8rzn8Gk3ymZCmpQpmT4tXshX6PrUHIlEkdrIrfebTgQhczsa2JFPO7t3wlBtQYwHYcDP1mISqT0FZBAJrTjJrzf54LYts6kYxZCJi9pRZABoAZDZD"}],"confirmed_at":"2015-03-20T07:58:02+0000","username":"test","email":"","admin":"false","stats":{"photos":{"total_count":0},"storage":{"used":0}},"friend_counts":{"requests":0,"following":0,"friends":0,"followers":0}}
App Management:
- id    550bd30a7eead2057e87576b Send Reset Password Email Set User as Admin User Change User Password
- created_at    2015-03-20T07:58:02+0000
- updated_at    2015-03-20T07:58:02+0000
- confirmed_at  2015-03-20T07:58:02+0000
- username  test
- admin false
- stats 
- Photos Total Count    0
- Storage Used  0
- friend_counts 
- requests  0
- following 0
- friends   0
- followers 0

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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