Firebase Config
It gives information about the Firebase setup.
Last updated
It gives information about the Firebase setup.
Last updated
This app uses Firebase as a backend to read and write data from database. In this section, you will find all the steps required for the app setup in order to be connected with Firebase.
First you should create a free Firebase account and create a new app there. You can visit firebase.google.com and signup or Login. If you have account you can create a firebase app project. Enter your own project Name and Select Region and it will create a firebase project for you.
Once project Created, Navigate into Overview menu on left side then you can see Add Firebase to your ionic app like screenshot below. Latest UI of firebase website may change so our screenshot might looks different compare to their new UI but there link and functionality almost same.
Above firebase credential you can get from In project Setting > General in bottom you can select Add firebase to web app .
Once you copy the credential can replace the current config details in firebase.config.ts .
Once you updated your firebase config you need to setup Firestore Database. You can click on database Left Menu and click on button "Create Database" Select Start in test mode & enable it, the database will be created.
Click on Project overview >project settings >service accounts >generate new private key there your google.services.json file gets downlaoded ..open the downloaded file then go to src>android >app folder there is one google .services,json file paste the contents which ever you copied .
Then go to dbshare.ionicfirebaseapp.com login with the credentials paste the file whichever you copied from google.service.json in the source account key and Copy Database from Your Source to Your Destination Account as firestore to firestore then click on next as the screenshot given below .
Once you are done with the above procedure your database gets added in the database field as displayed in the screenshot below ... and run the application again once the app gets open create new user there you need to go to users if in case if you want to give any users admin role you need to just click on edit and change it so that particular user role gets changed to admin and you can login with that credentials .
Here you can create a collection for store all the docs inside that collection . Once you run our app and change config with your there no product will show. You need to add some product from our backend dashboard or import dummy data from our database .
There no direct process to import/Export dummy JSON in FireStore like we have firebase realtime database. We have develop a tool there you can add your fireStore account details and our script will copy dummy data from our account to yours account .
To Registration and Login to apps you need to activate firebase auth Email / password and To config the social Login you need to enabled them and add the API key that you need to create on Facebook or Twitter developer account.
You can check Create social app section to create app ID for Facebook, Google +, Twitter.
Once you enable Facebook you need to Enter App ID and App Secret Key that you can get once create Facebook App.
You can Setup Social auth as well but you need do some changes in apps side as well. If you complete all the point successfully now you able to Login, Register to apps and order any product and all the order item store in your Firebase Database.
You need to update database rule to read and write to all initial setup later based on your requirement to you can update it.
Firebase Storage is used to store user profile pictures. If you completed all the steps successfully then you can run ionic Firebase app and then you can Register or Login or Order a Product. It will store in your Firebase Database.