Я пытаюсь реализовать приложение Phone-Auth для iOS.
Я получаю сообщение об ошибке error.localizedDescription: Несоответствие токена.
Что это значит? «Несоответствие токенов» мне ничего не говорит ...
Кроме того, я получаю эту ошибку: «Это поддельное уведомление должно быть отправлено в Firebase Auth.»
Код:
PhoneAuthProvider.provider().verifyPhoneNumber(phoneNumber, uiDelegate: nil) { (verificationID, error) in
if let error = error {
print(error.localizedDescription)
return
}
// Sign in using the verificationID and the code sent to the user
// ...
AppDelegate:
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let firebaseAuth = Auth.auth()
firebaseAuth.setAPNSToken(deviceToken, type: AuthAPNSTokenType.prod)
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
let firebaseAuth = Auth.auth()
if (firebaseAuth.canHandleNotification(userInfo)){
print(userInfo)
return
}
// Print full message.
print(userInfo)
completionHandler(UIBackgroundFetchResult.newData)
}