title: Verification ID used to create the phone auth credential is invalid iOS
body: <p>I can't login and always see this error message:</p>
  <blockquote>
  <p>The verification ID used to create the phone auth credential is invalid</p>
  </blockquote>
  <p>I tried to add my phone like tester, but I wasn't succeed on it.
  Sign in method is turn on in Firebase console.</p>
  <p>I found the same issue <a href="https://stackoverflow.com/q/55684514/11079607">here</a>, but without answer.
  I used <a href="https://firebase.google.com/docs/auth/ios/phone-auth" rel="nofollow noreferrer">firebase's docs.</a>
  Help me please to figure it out.</p>
  <p>Here my code:</p>
  <pre><code>func verifyPhone(_ phone: String) -&gt; AsyncTask&lt;String?&gt; {
      return AsyncTask&lt;String?&gt;({ observer, lifetime in
          guard !lifetime.hasEnded else {
              observer.sendInterrupted()
              return
          }
          Auth.auth().languageCode = &quot;ua&quot;
          PhoneAuthProvider.provider().verifyPhoneNumber(phone, uiDelegate: nil) { verificationID, error in
              if let error = error {
                  observer.send(error: AppError(error))
                  return
              }
              observer.send(value: verificationID)
              observer.sendCompleted()
          }
      })
  }
  
  func signInViaPhoneNumber(usingCode smsCode: String) -&gt; AsyncTask&lt;Void&gt; {
      return AsyncTask&lt;Void&gt;({ observer, lifetime in
          guard !lifetime.hasEnded else {
              observer.sendInterrupted()
              return
          }
          guard let verificationCode = UserDefaultsStorage.verificationCode else {
              observer.send(error: AppError.logic(&quot;Відсутній код верифікації&quot;))
              return
          }
          
          let credential = PhoneAuthProvider.provider().credential(withVerificationID: smsCode,
                                                                   verificationCode: verificationCode)
          Auth.auth().signIn(with: credential) { result, error in
              if let error = error {
                  observer.send(error: AppError(error))
                  return
              }
              
              guard let firUser = result?.user else {
                  observer.send(error: AppError.logic(&quot;Відсутній юзер&quot;))
                  return
              }
              let factory: ModelFactory = ModelFactoryImpl()
              let appUser = factory.makeUser(id: firUser.uid, name: firUser.displayName ?? &quot;&quot;, phone: firUser.phoneNumber ?? &quot;&quot;)
              AppService.shared.user = appUser
              observer.send(value: ())
              observer.sendCompleted()
          }
      })
  }
  </code></pre>