gpt4 book ai didi

ios - Firebase 电话身份验证失败

转载 作者:行者123 更新时间:2023-11-28 23:56:41 26 4
gpt4 key购买 nike

我想使用电话身份验证进行 Firebase 登录。由于我正在开发并且无法访问设备和 Apple 开发者帐户,因此我使用

实现了此功能

reCAPTCHA verification

但我得到以下错误

{"error":{"code":403,"message":"Requests from this ios client application are blocked.","errors":[{"message":"Requests from this ios client application are blocked.","domain":"global","reason":"forbidden"}],"status":"PERMISSION_DENIED"}}

我已经实现了它,因为它已在文档中显示。

下面是来自 AppDelegate.swift 的代码:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
FirebaseApp.configure()
return true
}

// For iOS 9+
func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
if Auth.auth().canHandle(url) {
return true
}
return false
// URL not auth related, developer should handle it.
}

下面是来自 ViewController.swift 的代码:

@IBAction func didTapSignUp(_ sender: Any) {
PhoneAuthProvider.provider().verifyPhoneNumber("+919637892151", uiDelegate: nil) { (verificationId, error) in
if let error = error {
// It always comes here
print(error.localizedDescription)
}
if let verificationId = verificationId {
print(verificationId)
UserDefaults.standard.set(verificationId, forKey: "authVerificationID")
}
}
}

最佳答案

我关注了this answer并且有效。

“将 Google 控制台中的 API key key 限制设置为无”

不过我很困惑,因为如果只有 NONE 有效,它的目的是什么?

关于ios - Firebase 电话身份验证失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51062724/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com