文書化されていない呼び出しを使用せずに、Facebook 資格情報からユーザーを作成したいと考えています。以下の 2 つの既知の理由から、Parse Javascript ライブラリの現在の実装に基づいてそれが可能であるとは思えません。
1.ライブラリの現在の実装は Appcelerator HTTP クライアントをサポートしていないため、すぐに失敗します。この問題に対処するには、既存の Parse Javascript ライブラリの ajax メソッドを拡張してAppcelerator HTTP client
.
http://www.clearlyinnovative.com/blog/post/34758524107/parse-appcelerator-titanium-the-easy-way
私が作成したスライド デッキには約 2,000 回のビューがあり、ブログ投稿にもほぼ同じビューがあったので、人々がこれを機能させたいと思っていることは明らかです。
2.ライブラリの現在の実装では、Facebook Javascript ライブラリとの統合が想定されており、そのライブラリは Appcelerator でも機能しません。実際、Appcelerator は Facebook をフレームワークに直接統合しているため、javascript ライブラリは必要ありません。ユーザー アカウントを Facebook にリンクするために必要なすべての情報は、Appcelerator 開発者が既に使い慣れている API 呼び出しを使用して簡単に取得できます。
元の質問は Parse Support フォーラムから削除されたので、より広いコミュニティからの解決策を探しています。
こんにちはアーロン、
ドキュメント化されていない 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 フォーラムに関する質問
パースフォーラムに関する質問