2

I am building iOS application using Firebase UI Phone Authentication latest version of Firebase Auth.

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.

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.

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...). 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.

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?? Why does it require reCAPTCHA verification and then after verified and screen keeps blank ??

1

2 Answers 2

2

Enter The Below Code before you ask for VerificationID.

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

Check Documentation

0

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.