titanium - How do you integrate the Parse Javascript API with Appcelerator and not use undocumented calls? -
i create user his/her facebook credentials without using undocumented calls. not believe possible based on current implementation of parse javascript library 2 known reasons:
1. current implementation of library not support appcelerator http client fails immediately. have addressed issue extending existing parse javascript library's ajax method utilize appcelerator http client.
http://www.clearlyinnovative.com/blog/post/34758524107/parse-appcelerator-titanium-the-easy-way
there has been approximately 2k views on slide deck created , same on blog post, pretty clear me people want work.
2. current implementation of library assumes integrating facebook javascript library , library not work appcelerator either. in fact appcelerator has integrated facebook directly framework there no need javascript library. of information required link user account facebook can gotten using api calls appcelerator developers familiar with.
the original question removed parse support forum looking solution wider community.
hi aaron,
it's not helpful other developers promote using undocumented apis in parse library workaround, make decision unlist it. understand might in particular case titanium, , you're aware of implications of using private apis, other users might overlook warning. hope understand.
héctor ramos solutions architect, parse https://parse.com/help
this code dangerous left visible on forum:
// setting auth data retrieved 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 resolved problem, calling _handlesaveresult(true) on returned user object, // dont think should have been difficult // attempt log user in using fb information var user = new parse.user(); user.save({ "authdata" : authdata }).then(function(_user) { // force user become current _user._handlesaveresult(true); //<-- evil method called if (!_user.existed()) { // add additional user information var userinfo = { "acct_email" : "bryce@xxxxxx.com", "acct_fname" : "bryce", "acct_lname" : "saunders" }; return _user.save(userinfo); } }).then(function(_user) { alert('hooray! let them use app now.'); }, function(error) { alert(' error: ' + json.stringify(error, null, 2)); }); question on appcelerator forum
question on parse forum
maybe part of newer sdk, can't call:
parse.facebookutils.login({ "facebook": { "id": "user's facebook id number string", "access_token": "an authorized facebook access token user", "expiration_date": "token expiration date of format: yyyy-mm-dd't'hh:mm:ss.sss'z'" }, { success : function(_user) {}, error : function(_user, error) {} } }; it's not documented in javascript guide, documented in unminified version of code visa vie:
@param {string, object} permissions permissions required facebook log in. comma-separated string of permissions. alternatively, supply facebook authdata object described in our rest api docs if want handle getting facebook auth tokens yourself. i made updates original code support lastest sdk i'm going publish on github.
thanks spearheading effort. original post saved me hours.
Comments
Post a Comment