我有一個用swift編寫的使用Facebook登錄(FBSDK 4.11.0)的iOS應用程序。該應用程序正在生產中,並且FB-login完美無缺。使用FBSDK for iOS登錄凍結
但是,在進行新更新時,我意識到我無法再使用FB登錄或註冊。登錄過程在彈出webview中授權應用程序後停止。它加載一個空白頁面並靜置。
下面的代碼是完全相同的代碼,目前在應用商店版本上運行完美。我認爲這可能與應用程序目前處於開發狀態有關,但在創建測試版並通過testflight下載後,我仍然遇到同樣的問題。
這是我的代碼。
func fbLoginInitiate() {
if hasSeenPermissionPopup(LoginType.Facebook){
Globals.mixpanel.track("Initiated FB login")
FBSDKLoginManager().logInWithReadPermissions(["public_profile", "email", "user_birthday"], fromViewController: self, handler: {(result:FBSDKLoginManagerLoginResult!, error:NSError!) -> Void in
if (error != nil) {
// Process error
self.removeFbData()
} else if result.isCancelled {
// User Cancellation
self.removeFbData()
} else {
//Success
if result.grantedPermissions.contains("email") && result.grantedPermissions.contains("public_profile") && result.grantedPermissions.contains("user_birthday") {
//Do work
self.fetchFacebookProfile()
} else {
Globals.mixpanel.track("Facebook login failed")
SweetAlert().showAlert("Ooops!", subTitle: "Noe gikk galt. Ta kontakt med Mojob dersom feilen vedvarer", style: AlertStyle.Warning)
}
}
})
}
}
錯誤在回調中爲零,並且結果僅顯示如果我取消請求。我沒有做任何更改info.plist或任何其他設置,在應用程序中與FB有關。
如果有人經歷過類似的事情,我會非常感激聽到您如何解決問題。
登錄的第一部分按預期工作
第二部分凍結
你在哪個iOS版本上?在iOS 10上注意到相同... – donnywals
我在版本9.3.2上 – ocwendel
謝謝!真的很感激它! – ocwendel