Firebaseui-ios: Phone Verification - Invalid Token - FIRAuth Error Domain Code 17048 - With APN Authentication key

Created on 6 May 2018  路  11Comments  路  Source: firebase/FirebaseUI-iOS

Step 2: Describe your environment

  • Objective C or Swift: Objective C
  • iOS version: All Versions
  • Firebase SDK version: latest pod update ( as of 6-May-2018)
  • FirebaseUI version: latest pod update ( as of 6-May-2018)
  • CocoaPods Version: latest pod update ( as of 6-May-2018)

Step 3: Describe the problem:

We have Phone Verification working without any issue in Android. Tried integrating with FirebaseUI for iOS and was getting error with phone verification "Invalid Token - FIRAuth Error Domain Code 17048" ( Other verifications are working correctly )

Followed instruction from this link https://firebase.google.com/docs/auth/ios/firebaseui

Steps to reproduce:

  1. Setup Phone number verification as mention in link https://firebase.google.com/docs/auth/ios/firebaseui.
    Uploaded "APNs Authentication Key"
    "APNs authentication key under iOS app configuration, click the Upload button. "

If we delete APN's Authentication key and upload APNs Certificates ( prod and dev ) phone verification is done without any issue

Observed Results:

Phone Verification fails with error Invalid Token - FIRAuth Error Domain Code 17048
If we delete APN's Authentication key and upload APNs Certificates ( prod and dev ) phone verification is done without any issue

Expected Results:

allos phone verification

Relevant Code:

// TODO(you): code here to reproduce the problem

Most helpful comment

Make sure your Auth key belongs to the same Team ID as the one used to sign your application. For most teams this is the same as the App ID Prefix, but for others it may not be.

All 11 comments

That's this error, indicating your client has an invalid APNS token.

@morganchen12 - Thanks for your reply. When we remove APN's Authentication key and upload APNs certificates - Phone verfication starts working in production as well as in development without any ios code change. Can you please tell us what change is required on ios side to make it working with APN's Authentication key? I have followed the instructions provided on developer.google.com

Make sure your Auth key belongs to the same Team ID as the one used to sign your application. For most teams this is the same as the App ID Prefix, but for others it may not be.

yes I veritify its same Team ID as signing ID

To check if it's an auth key issue, are you able to send notifications directly through APNs with the auth key? This link may be helpful.

Thanks we will test and share result.

@RachitTechnology is this still an issue?

Got it working with APNs certificates but never got chance to test with your solution for APN's Authentication key. Will close this for now

I Guess found the problem
After Uploading APNs auth key (.p8 file), Team ID in general settings was wrong. After setting right Team ID in general settings fixed the issue for me.

I know this issue is closed, but one thing to check is whether you uploaded the .p8 Auth key to firebase at all. That was my problem. I duplicated an app to make a new one and forgot to upload the .p8 key. It's in the firebase project - click the gear, then Project Settings, then upload it under APNS App configuration. More details here: https://firebase.google.com/docs/auth/ios/phone-auth

Was this page helpful?
0 / 5 - 0 ratings