Reputation: 1490
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 ??
Upvotes: 2
Views: 6422
Reputation: 501
Enter The Below Code before you ask for VerificationID.
Auth.auth().settings?.isAppVerificationDisabledForTesting = true
Upvotes: 2
Reputation: 31
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
Upvotes: 0