phonegap facebook plugin と facebook javascript api を使用しています。ここに私のコードがあります
FB.init({
appId: "xxxxxxxxxxxxxxx",
status: true,
oauth :true,
nativeInterface: CDV.FB,
//channelURL : 'www', // Channel File
cookie: true,
//useCachedDialogs: false,
xfbml: true
});
FB.login(function(response) {
if (response.authResponse) {
alert(response.authResponse.userID); // literally shows three dots
FB.api('/me', function(me){
if (me.id) {
alert(me.id); // this works
}
});
}
}, { scope: "email" });
authResponse から accessToken を取得できます....長い文字列です。しかし、userID フィールドは文字どおり "..." です。フェッチする別のグラフ API 呼び出しを使用してサーバーへの余分な往復を行うことで、ユーザーの ID を取得できます/me
が、それは無駄に思えます。