Make sure you're following this guide step by step:-
If you haven't added a Firebase project, You have to add a project on Firebase and register PhoneNumber authentication in that project. Follow below steps to add:-
a) go to https://console.firebase.google.com/u/0/ and click on add project.
b) Enter project name and select your region, then click create project.
c) Now in your project dashboard, click on Authentication. Then on right side, click on "Sign-in method" and enable the "Phone" authentication. Initially it should show as "Disabled".
d) Click on Save.
If you've not requested your ContactSyncer API key and Secret key, please request one from here:- http://participateme.com/contactsyncer/#contact
Git clone or download the sample
Change package name as per your requirement.
Add this package to your firebase project which you have created above. To know how to add, follow below steps:-
a) Click on "setting" icon on right side of your Firebase project overview section and then click on project settings.
b) On bottom, click "Add Firebase to your Android Project"
c) Add package name of your app as per step #2 and make sure you type in your SHA 1. To get SHA1, follow below steps:-
MAC - open terminal and type:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Windows - https://stackoverflow.com/questions/30070264/get-sha1-fingerprint-certificate-in-android-studio-for-google-maps
d) Click "Register" app and then download and copy google-services.json file in your project folder as shown.
e) You can skip next step(Add Firebase SDK) as this is already added in this github sample. Click on finish.
Copy your secret key inside Utils.java file and simply run the sample.
Enabling Push Notification
- Go to your Firebase project overview section and then click on project settings.
- On right side, click on Cloud Messaging tab and copy your Legacy Server Key
- Copy this key in your Utils.java file in source folder.