[英]Issue with Wizcorp phonegap facebook plugin
我們正在嘗試集成Wizcorp PhoneGap facebook插件( https://github.com/Wizcorp/phonegap-facebook-plugin )以支持新的Ionic應用程序中的登錄過程。
登錄Facebook似乎對新用戶來說效果很好。 問題是當用戶注銷並嘗試重新登錄時他會收到錯誤:
Facebook錯誤:會話已關閉,未正常關閉
我們在這里做錯了什么?
這是我們現在使用的代碼:
function fbLogin() {
facebookConnectPlugin.login(['email'], function (response) {
alert("Login Successfull");
alert(JSON.stringify(response));
}, function (error) {
alert("Login ERROR");
alert(JSON.stringify(error));
})
}
function getDetails() {
facebookConnectPlugin.getLoginStatus(function (response) {
if (response.status === 'connected') {
alert("You're connected!");
var userID = response.authResponse.userID;
facebookConnectPlugin.api('/' + response.authResponse.userID + '?fields=id,name,picture.width(400).height(400)', [], function (result) {
alert(JSON.stringify(result));
})
} else if (response.status === 'not_authorized') {
alert("Not Autherized!");
} else {
alert("You're not loggin into Facebook!");
}
});
}
function fbLogout() {
facebookConnectPlugin.logout(function (response) {
alert("Logout success");
alert(JSON.stringify(response));
}, function (error) {
alert("Logout ERROR");
alert(JSON.stringify(error));
})
}
我們已檢查此鏈接:
但是當我們嘗試實現下面的代碼時 - 我們得到一個錯誤
Tyeperror cordova.getActivity不是一個函數
PackageInfo info = cordova.getActivity().getPackageManager().getPackageInfo("com.goapes.golearn", PackageManager.GET_SIGNATURES);
上面的鏈接告訴我們在Facebook App Dashboard中需要另一個Hash Key,那么有另一種方法可以獲得這個Hash嗎?
我認為你最好試試這個插件。 因為我使用這個插件開發了一個應用程序,現在正在生產中。 :)這里檢查一下
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.