简体   繁体   English

Firebase 电话身份验证 reCAPTCHA 验证在某些设备上不起作用

[英]Firebase Phone Auth reCAPTCHA verification not working on some devices

I am building iOS application using Firebase UI Phone Authentication latest version of Firebase Auth.我正在使用 Firebase Auth 的 Firebase UI Phone Authentication 最新版本构建 iOS 应用程序。

When I tried to perform login using Phone Number on my device and it seem likes it doesn't require the reCAPTCHA verification and it works.当我尝试在我的设备上使用电话号码执行登录时,它似乎不需要 reCAPTCHA 验证并且可以正常工作。

Instead when I tried to run the application on other devices it requires reCAPTCHA verification but suddenly when the completion the verification that you're not robot I have seen the screen stays in blank and not working.相反,当我尝试在其他设备上运行该应用程序时,它需要 reCAPTCHA 验证,但突然当完成验证您不是机器人时,我看到屏幕保持空白且无法工作。

I have searched few answers on Stack Overflow and mentioned about enabling something in Background Modes (I have enabled Remote Notifications, Background Fetch, Voice over IP, Audio, Airplay...).我在 Stack Overflow 上搜索了几个答案,并提到了在后台模式中启用某些内容(我启用了远程通知、后台获取、IP 语音、音频、Airplay...)。 Other thing they mentioned about REVERSED_CLIENT_ID in GoogleService file that I have to copy that URL to to URL Schemes, Of course I have copied it.他们在 GoogleService 文件中提到的关于REVERSED_CLIENT_ID其他事情我必须将该 URL 复制到 URL Schemes,当然我已经复制了它。

Here are some of my delegate functions:以下是我的一些委托功能:

func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
    let firebaseAuth = Auth.auth()
    if (firebaseAuth.canHandleNotification(userInfo)){
        print("User infor ",userInfo)
        return
    }
}

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {

    let token = deviceToken.hexString
    print("====== This is device token ",deviceToken)

    let firebaseAuth = Auth.auth()
    // I used to set type .unknown to .prod as well and it doesn't work
    firebaseAuth.setAPNSToken(deviceToken, type: .unknown)
    InstanceID.instanceID().instanceID { (result, error) in
        if let error = error {
            NSLog("Error getting instance ID ", error.localizedDescription)
        } else if let result = result {
            Messaging.messaging().apnsToken = deviceToken
            UserDefaults.standard.setFCMToken(value: result.token)
        }
    }
    print("=============== Device token",deviceToken.description)
    if let uuid = UIDevice.current.identifierForVendor?.uuidString {
        print(uuid)
    }
    UserDefaults.standard.setValue(token, forKey: "ApplicationIdentifier")
    UserDefaults.standard.synchronize()


}

Is there anything else that I missed?还有什么我错过的吗? Why it doesn't work on other iOS devices??为什么它在其他 iOS 设备上不起作用?? Why does it require reCAPTCHA verification and then after verified and screen keeps blank ??为什么需要 reCAPTCHA 验证,然后验证后屏幕保持空白?

Enter The Below Code before you ask for VerificationID.在您要求 VerificationID 之前输入以下代码。

Auth.auth().settings?.isAppVerificationDisabledForTesting = true

Check Documentation 检查文档

I'm not sure what iOS version you are running but there is a problem in reCAPTCHA for iOS 13 and it's not solved yet我不确定您运行的是哪个 iOS 版本,但 iOS 13 的 reCAPTCHA 存在问题,但尚未解决

https://github.com/firebase/firebase-ios-sdk/issues/3706 https://github.com/firebase/firebase-ios-sdk/issues/3706

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase电话身份验证(Flutter)在某些iOS设备中不起作用 - Firebase Phone Auth (Flutter) is not working in some iOS devices Firebase电话身份验证限制 - Firebase phone auth verification limit 如何使用 firebase 为 IOS Flutter 禁用电话验证中的重新验证 - How to disable recaptcha verification in phone Authentication with firebase for IOS Flutter “电话身份验证凭据是使用空验证 ID 创建的”- Firebase SwiftUI - "The phone auth credential was created with an empty verification ID" - Firebase SwiftUI 电话号码身份验证不适用于 IOS 设备 [Firebase] - Authentication of phone number is not working on IOS Devices [Firebase] recaptcha 验证后的空白页使用电话号码 Swift 在 iOS 上使用 Firebase 进行身份验证 - blank page after recaptcha verification Authenticate with Firebase on iOS using a Phone Number Swift Firebase 电话身份验证在 iOS 上弹出 reCAPTCHA 验证 window 即使后台模式和推送通知已启用 - Firebase Phone Authentication pops up a reCAPTCHA verification window on iOS even if Background Modes and Push Notifications are enabled 用于生产时,Firebase Auth Phone无法正常工作 - Firebase Auth Phone not working when using for production Firebase 用户电话号码验证 - Firebase user phone number verification Firebase电话验证 - Firebase Phone Auth
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM