- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我已经实现了 firebase phone auth 来验证我项目中的电话号码,它对我来说工作正常,但无法更新电话号码。比如一个用户用手机号 A 登录,现在他想把这个更新到手机号 B。这将如何解决?
最佳答案
我找到了一个答案,您可以使用您的电子邮件帐户登录并将手机号码更新到同一帐户中。您可以使用该解决方案使用电话登录并将电话号码更新到同一帐户中,看看它是否有效。无论如何,我将在我的项目中研究这个确切的解决方案,然后更新答案。但在那之前,您可以尝试看看这是否有效。按照此处给出的常规 firebase 电话身份验证程序进行操作:https://firebase.google.com/docs/auth/ios/phone-auth
PhoneAuthProvider.provider().verifyPhoneNumber(phoneNumber, uiDelegate: nil) { (verificationID, error) in
if let error = error {
self.showMessagePrompt(error.localizedDescription)
return
}
// Sign in using the verificationID and the code sent to the user
// ...
}
let credential = PhoneAuthProvider.provider().credential(
withVerificationID: verificationID,
verificationCode: verificationCode)
那就不要用下面的代码
// Sign In The User
Auth.auth().signInAndRetrieveData(with: credential) { _, error in
}
但是使用这段代码
Auth.auth().currentUser?.linkAndRetrieveData(with: credential, completion: { _, error in
if error == nil {
print("Whopdee doo")
} else {
print("Aargh!!!")
}
})
关于ios - PhoneAuth 火力地堡 : Update Phone number,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47633804/
我需要创建一个具有 Firebase Phone Auth 的 Xamarin 应用程序(不是表单,而是独立的 iOS 和 Android 项目)。大多数文档表明支持 Facebook Auth,但我
我一直在尝试使用 Firebase Auth 进行电话身份验证方法,我确保遵循所有步骤,添加我的包名称,使用添加 SHA key keytool -list -v -keystore "%USERPR
我已经实现了 firebase phone auth 来验证我项目中的电话号码,它对我来说工作正常,但无法更新电话号码。比如一个用户用手机号 A 登录,现在他想把这个更新到手机号 B。这将如何解决?
我正在“我的应用”中设置 Firebase Phone Auth。我在 firebase auth 部分白名单中设置了一个测试电话号码和一个验证码。当我用这个数字和代码进行测试时,它工作正常。但是当我
我开发了一个具有 firebase 电话号码身份验证的 android 应用程序。输入电话号码后,firbase 通过短信发送验证 OTP 号码。所以我在我的应用程序中添加并允许 SMS 读取权限 现
我正在尝试使用 Email and Password 首次登录用户, 然后在它之后,我想要 user's Phone Number也。所以我首先使用他的 EmailAndPasswordAuth 为用
将 Xcode 更新到 10.3 后,我收到以下错误(我认为这与 firebase 有关): 随附的页面是: 为什么会发生此错误以及如何修复它? 我尝试过的: 正在更新 Pod 重新启动 Xcode
我收到 INVALID_APP_CREDENTIAL:执行 verifyPhoneNumber() 时应用验证失败。我已成功输入 SHA-1 证书进行发布和调试,但问题仍然存在。还要交叉检查是否将正确
我尝试从 firebase 设置 PhoneAuth,但我是新的,我只是不知道为什么会这样 这是部分代码 let credential: PhoneAuthCredential = PhoneAut
我是一名优秀的程序员,十分优秀!