如何将parsingJavascript API与Appcelerator集成,而不使用无证电话?

我想创build一个用户从他/她的Facebook凭证,而不使用无证电话。 我不相信这是可能的基于两个已知的原因的parsingJavascript库的当前实现:

1.库的当前实现不支持Appcelerator HTTP客户端,因此它立即失败。 我已经通过扩展现有的Parse Javascript库的ajax方法来利用Appcelerator HTTP client来解决这个问题。

http://www.clearlyinnovative.com/blog/post/34758524107/parse-appcelerator-titanium-the-easy-way

在我创build的幻灯片上已经有大约2K的观点,并且在博客文章中也是如此,所以我很清楚,人们希望这个工作。

2.库的当前实现假定您正在与Facebook Javascript库集成,该库也不能与Appcelerator一起使用。 实际上,Appcelerator已经将Facebook直接集成到框架中,所以不需要JavaScript库。 所有将用户帐户链接到Facebook所需的信息都可以使用Appcelerator开发人员熟悉的API调用轻松获得。

最初的问题已从Parse支持论坛中删除,所以我正在寻找更广泛的社区的解决scheme。

嗨,亚伦,

对于其他开发人员来说,促进在Parse库中使用未公开的API作为解决方法是没有帮助的,所以我做出将其取消的决定。 我知道这可能会有助于您使用Titanium的特定情况,并且您很清楚使用私有API的含义,但其他用户可能会忽略该警告。 我希望你明白。

HéctorRamos解决scheme架构师,parsinghttps://parse.com/help

这是太危险的代码,不能在论坛上看到:

 // 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" : "bryce@xxxxxx.com", "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)); }); 

关于Appcelerator论坛的问题

http://developer.appcelerator.com/question/152146/facebook-appcelerator-and-parse-integration-need-help

在parsing论坛上的问题

https://parse.com/questions/how-do-you-integrate-the-parse-javascript-api-with-appcelerator-and-not-use-undocumented-calls

也许这是一个较新的SDK的一部分,但不能只是调用:

 Parse.FacebookUtils.logIn({ "facebook": { "id": "user's Facebook id number as a string", "access_token": "an authorized Facebook access token for the user", "expiration_date": "token expiration date of the format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" }, { success : function(_user) {}, error : function(_user, error) {} } }; 

它没有logging在Javascript指南中,但是在代码签证的未分类版本中记载:

 @param {String, Object} permissions The permissions required for Facebook log in. This is a comma-separated string of permissions. Alternatively, supply a Facebook authData object as described in our REST API docs if you want to handle getting facebook auth tokens yourself. 

我对原始代码进行了一些更新,以支持我将在Github上发布的最新SDK。

非常感谢带头的努力。 你原来的post节省了我的时间。