Created
May 8, 2013 21:54
-
-
Save aaronksaunders/5543970 to your computer and use it in GitHub Desktop.
UPDATED FIX AVAILABLE HERE: http://bit.ly/1oaipIo Trying to create and link a facebook user to parse using appcelerator titanium. This solution listed below works BUT the question was removed from the Parse QA forum because I am using an undocumented method from an open source javascript library... don't quite understand that, but I am looking f…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// setting auth data retrieved from Ti.Facebook login | |
authData = { | |
"facebook" : { | |
"id" : Ti.Facebook.uid, | |
"access_token" : Ti.Facebook.accessToken, | |
"expiration_date" : expDate, // "format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" | |
} | |
}; | |
// Either way I resolved the problem, calling _handleSaveResult(true) on the returned user object, | |
// I just dont think it should have been as difficult as it was | |
// attempt to log the user in using the FB information | |
var user = new Parse.User(); | |
user.save({ | |
"authData" : authData | |
}).then(function(_user) { | |
// force the user to become current | |
_user._handleSaveResult(true); //<-- this is the evil method I called | |
if (!_user.existed()) { | |
// add additional user information | |
var userInfo = { | |
"acct_email" : "[email protected]", | |
"acct_fname" : "Bryce", | |
"acct_lname" : "Saunders" | |
}; | |
return _user.save(userInfo); | |
} | |
}).then(function(_user) { | |
alert('Hooray! Let them use the app now.'); | |
}, function(error) { | |
alert(' ERROR: ' + JSON.stringify(error, null, 2)); | |
}); |
This is the updated question on Parse Support that is waiting for a response https://parse.com/questions/how-do-you-integrate-the-parse-javascript-api-with-appcelerator-and-not-use-undocumented-calls
Hi Aaron,
I've seen the thread on Parse's forums and seen a related post of yours on Titanium Q&A and wondered if you ever got any further with Parse? We're look at transitioning our current solution from ACS to Parse and logging in with FB is a critical feature for us.
Cheers,
Terry
fix available here: http://bit.ly/1oaipIo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the response I received from Parse Support
Hi Aaron,
It's not helpful to other developers to promote using undocumented APIs in the Parse library as a workaround, so I make the decision to unlist it. I understand it might help in your particular case with Titanium, and you're well aware of the implications of using private APIs, but other users might overlook that warning. I hope you understand.
Héctor Ramos
Solutions Architect, Parse
https://parse.com/help