0
我很難找出如何在使用AWS Cognito的恢復會話期間確定登錄類型。我的代碼基於MobileHub示例(下面)。在恢復會話期間使用AWS Cognito確定登錄類型(Swift)
我已經集成了用戶池(帳戶創建和登錄)的名稱/密碼模式以及所有完美工作的Facebook登錄按鈕。
我的應用程序需要根據登錄類型採取不同的行爲,但我無法弄清楚如何去做。
任何人都這樣做?
我很難找出如何在使用AWS Cognito的恢復會話期間確定登錄類型。我的代碼基於MobileHub示例(下面)。在恢復會話期間使用AWS Cognito確定登錄類型(Swift)
我已經集成了用戶池(帳戶創建和登錄)的名稱/密碼模式以及所有完美工作的Facebook登錄按鈕。
我的應用程序需要根據登錄類型採取不同的行爲,但我無法弄清楚如何去做。
任何人都這樣做?
一個解決方案,我發現是投給不同身份的個人資料類型,如下列:
let identityManager = AWSIdentityManager.default()
if let fbIdentityProfile = identityManager.identityProfile as? FacebookIdentityProfile {
print("didFinishLaunching - Facebook login")
} else if let upIdentityProfile = identityManager.identityProfile as? UserPoolsIdentityProfile {
print("didFinishLaunching - User Pools login")
}
我可以在我的身邊這個應用模型的邏輯。不確定使用MobileHub幫助程序類或AWS API是否有更簡潔的方法,但是可行。