我添加到 phonegap 应用程序 Facebook Connect,它工作正常并生成访问令牌,但是当我尝试获取用户 ID 时,我的函数的值为 “Undenified” :
FB.init({
appId: "************",
nativeInterface:CDV.FB,
xfbml: true,
useCachedDialogs: false,
status: true,
cookie: true,
oauth: true
});
//alert("Init Done");
FB.getLoginStatus(function (response) {
if (response.authResponse) {
if (response.status == 'connected') {
Token = response.authResponse.accessToken;// This one is Good!
userid = response.authResponse.userID;// This one is Bad
}