Parse Javascript API를 Appcelerator와 어떻게 통합하고 문서화되지 않은 호출을 사용하지 않습니까?
문서화되지 않은 통화를 사용하지 않고 Facebook 자격 증명으로 사용자를 만들고 싶습니다. 두 가지 알려진 이유로 Parse Javascript Library의 현재 구현을 기반으로 할 수 있다고 생각하지 않습니다.
1. 라이브러리의 현재 구현은 Appcelerator HTTP 클라이언트를 지원하지 않으므로 즉시 실패합니다. 나는 기존 Parse Javascript 라이브러리의 ajax 메서드를 확장하여 Appcelerator HTTP client
.
http://www.clearlyinnovative.com/blog/post/34758524107/parse-appcelerator-titanium-the-easy-way
내가 만든 슬라이드 데크와 블로그 게시물에서 거의 동일한 조회수가 약 2K에 이르렀 기 때문에 사람들이 이것이 작동하기를 원한다는 것이 분명합니다.
2. 라이브러리의 현재 구현에서는 Facebook Javascript 라이브러리와 통합 중이며 해당 라이브러리가 Appcelerator에서도 작동하지 않는다고 가정합니다. 사실 Appcelerator는 Facebook을 프레임 워크에 직접 통합했기 때문에 자바 스크립트 라이브러리가 필요하지 않습니다. 사용자 계정을 Facebook에 연결하는 데 필요한 모든 정보는 Appcelerator 개발자가 이미 익숙한 API 호출을 사용하여 쉽게 얻을 수 있습니다.
원래 질문은 Parse 지원 포럼에서 제거되었으므로 더 넓은 커뮤니티에서 솔루션을 찾고 있습니다.
안녕 Aaron,
해결 방법으로 Parse 라이브러리에서 문서화되지 않은 API를 사용하여 홍보하는 것은 다른 개발자에게 도움이되지 않으므로 목록을 제거하기로 결정했습니다. Titanium의 특정 경우에 도움이 될 수 있음을 이해하고 개인 API 사용의 의미를 잘 알고 있지만 다른 사용자는 해당 경고를 간과 할 수 있습니다. 난 당신이 이해 바랍니다.
Héctor Ramos 솔루션 설계자, Parse https://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 포럼에 대한 질문
Parse 포럼에 대한 질문
최신 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) {}
}
};
It's not documented in the Javascript guide, but it is documented in the unminified version of the code visa vie:
@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.
I made some updates to your original code to support the lastest SDK which I'm going to publish on Github.
Thanks so much for spearheading this effort. Your original post saved me hours.
'Program Tip' 카테고리의 다른 글
Google지도는 경로에서 드래그시 경로를 강조 (0) | 2020.11.25 |
---|---|
Scala 미들웨어 선택의 차이점은 무엇입니까? (0) | 2020.11.25 |
MonadRef를 사용하여 MonadCont 구현 (0) | 2020.11.25 |
OpenGL과 함께 onSensorChanged 센서 데이터를 사용하는 방법 (0) | 2020.11.25 |
five.grok에서 ZCML allowed_attributes 해당 메서드 (0) | 2020.11.25 |