You will need your project from Firebase Console.
- Copy your credentials (click for Web in console) and create
src/app/env.config.ts
- In Authentication tab in Firebase Console go to login methods and turn on Phone Auth
- Optional. Add test phone number in Firebase Console
- Add your application. Make sure your package ID match the one in Firebase Console - e.g.
com.ionicfirebasephoneauth.demo
- Add SHA-1 blueprint - important!
- Download
google-services.json
and paste it in root folder of project - Run app with
ionic cordova run android --device
- Number prefix is hardcoded and set to
+48
- How to get SHA-1 - https://stackoverflow.com/questions/15727912/sha-1-fingerprint-of-keystore-certificate
- If you encounter
EACCES
- https://stackoverflow.com/questions/43700489/ionic-build-android-error-spawn-eacces - If any other issues will appear put it here - https://github.com/sajTempler/IonicFirebasePhoneAuth/issues
Written with StackEdit.