[英]iOS Facebook SDK Login Failure after Deleting Facebook Account and Restoring it
[英]facebook login failure on iOS device
我正在使用cocoonjs制作HTML5應用程序,當我嘗試登錄到Facebook時,因為我單擊登錄按鈕,它會在safari上打開facebook應用程序或facebook網站,在此之后,如果我關閉facebook app / safari,則我的應用程序不會收到此通知某種登錄失敗
我該如何檢測?
這是我的代碼
if (this.socialService && !this.socialService.isLoggedIn()) { this.socialService.login(function(session) { self.log(session); if (session.status !== "connected") { console.log("not connected"); } }, { scope: "publicprofile,user_friends" }); } else { console.log("not connected"); }
Facebook js sdk的文檔有一個示例:
FB.login(function(response) {
if (response.status === 'connected') {
// Logged into your app and Facebook.
} else if (response.status === 'not_authorized') {
// The person is logged into Facebook, but not your app.
} else {
// The person is not logged into Facebook, so we're not sure if
// they are logged into this app or not.
}
});
檢查代碼的session.status
以檢查條件,如示例中所示。 如果狀態不是“ connected
或“ not_authorized
以外的其他狀態,則可能意味着Facebook應用/野生動物園已關閉。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.