Firebase (Phone Auth) Getting iOS error: register custom URL scheme

My flutter app uses Firebase Auth (Phone). I keep seeing the error: 'Please register custom URL scheme 'com.googleusercontent.apps.602546125958-5lk04ghhdfj5xxxxxxxx'.

I have added the URL schema to the info.plist as follows, but I'm getting the same error.

enter image description here

2020-04-29 20:40:05.173962-0400 Runner[395:20944] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Please register custom URL scheme 'com.googleusercontent.apps.602546125958-5lk04ghhdfj5xxxxxxxx' in the app's Info.plist file.'
*** First throw call stack:
(0x1889035f0 0x188625bcc 0x1887f9b28 0x10086cfa8 0x100f056a0 0x102efb3b0 0x102e921bc 0x102eeb9cc 0x102ea2a68 0x102ea4dcc 0x1888821c0 0x188881edc 0x1888815b8 0x18887c5c8 0x18887bc34 0x1929c538c 0x18c9ae22c 0x10082addc 0x188703800)
libc++abi.dylib: terminating with uncaught exception of type NSException

Delete you URL Type entry from .plist file and follow the steps, .plist entry will be automatically generated.

This works for Flutter as well

Steps:

enter image description here

You can click on + in URL Types if you want to add more than 1 URL Schemes.

Please comment if you have any questions.

Happy to help!


I had the same problem. Try with the following setting.

enter image description here


There is a Firebase documentation for iOS phone verification setup:

To enable the Firebase SDK to use reCAPTCHA verification:

Add custom URL schemes to your Xcode project:

  1. Open your project configuration: double-click the project name in the left tree view. Select your app from the TARGETS section, then select the Info tab, and expand the URL Types section.
  2. Click the + button, and add a URL scheme for your reversed client ID. To find this value, open the GoogleService-Info.plist configuration file, and look for the REVERSED_CLIENT_ID key. Copy the value of that key, and paste it into the URL Schemes box on the configuration page. Leave the other fields blank. When completed, your config should look something similar to the following (but with your application-specific values):

https://firebase.google.com/docs/auth/ios/phone-auth?authuser=0

Works for Flutter too.