When I tried to Sign In using Phone Auth by FirebaseUI on my device it doesn't require the reCAPTCHA to verify that you're are not robot.
But when I tried to test on some other devices after I input phone number and click on verify and then it display the reCAPTCHA to verify that you are not robot. After I done verification and then the screen seem like in blank and it doesn't callback. Even I tried to test on simulator it display the same result.
The reCAPTCHA should display on simulator only, right? Why does it happen on actual device???
reCAPTCHAreCAPTCHA should be displayed on simulator only, why does it show on actual devices and some devices not display the reCAPTCHA?Code that relevance to firebase setup
```
fileprivate func firebaseConfig() {
FirebaseConfiguration.shared.setLoggerLevel(FirebaseLoggerLevel.min)
FirebaseApp.configure()
authUI = FUIAuth.defaultAuthUI()
authUI?.delegate = self
Messaging.messaging().delegate = self
}
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) {
print("========== Firebase registration token: (fcmToken)")
let dataDict:[String: String] = ["token": fcmToken]
NotificationCenter.default.post(name: Notification.Name("FCMToken"), object: nil, userInfo: dataDict)
// TODO: If necessary send token to application server.
// Note: This callback is fired at each app startup and whenever a new token is generated.
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let token = deviceToken.hexString
print("====== This is device token ",deviceToken)
let firebaseAuth = Auth.auth()
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()
}
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
}
}
```
The captcha will show on device whenever the background notification delivery fails for whatever reason. Silent notification delivery isn't guaranteed, so seeing a captcha from time to time is normal. There's nothing wrong with your implementation.
@morganchen12 Thanks for reply. I am not complaining about displaying the captcha. What I am wondering is that after the completion of verification captcha page only return blank.
Here is similar issue I found on stackoverflow
Please reopen this issue if possible
Have you tried the solution mentioned in the StackOverflow question you linked?
My bad! It doesn't work because I run it on my teammate laptop and he confused to disable Push Notification capabilities.