AWS Cognito を使用して、google+ を使用して iOS アプリを AWS Mobile Hub に認証しています。認証は正常に機能しますが、Google+ アカウントからメール アドレスを取得する方法を見つけるのに苦労しています。ユーザー名とその Cognito ID は簡単に取得できますが、メールアドレスを取得することはできますか? MS Azureではできますが、サーバー側ではできます。これはSwift 3.0の私のコードです:
AWSIdentityManager.defaultIdentityManager().loginWithSign(signInProvider!, completionHandler: {(result: Any?, error: Error?) in
if error == nil {
DispatchQueue.main.async {
controller.dismiss(animated: true, completion: nil)
}
print(AWSIdentityManager.defaultIdentityManager().userName)
print("-------------")
print(result)
}
})