我使用facebook cordova插件。我试图让用户的名字显示在我的其他html页面上。但有些人如何工作。我没有登录到facebook
function Login()
{
facebookConnectPlugin.browserInit();
facebookConnectPlugin.login(["user_birthday","public_profile","email"]);
facebookConnectPlugin.api("/me/?fields=name", ["user_birthday","public_profile","email"],
function (result) {
document.location.href = "./customer.html#"+String(result.name);
/* alerts:
{
"id": "000000123456789",
"email": "myemail@example.com"
}
*/
},
function (error) {
alert("Failed: " + error);
});
}
如果我删除facebookConnectPlugin.browserInit();并在android上模拟它。它会在Facebook上登录,但完成后页面根本不会改变