Setting up the project
You will receive a bundle.zip file on download. It will have 3 folders
- App - This file contains all the code for Arivaa Firebase
- firebase-cloud-functions - Contains the cloud functions that need to deployed to firebase.
- Documentation.rtf (Contains the links to the website for Arivaa Firebase and its documentation)
- Node.js version >=6.0 and <=8.5.x should be installed. Download here (Note - Please don't use Node 10.x.x since it is not compatible with most of expo and react native yet.)
- NPM Version >=3.0 should be installed.
- React Native CLI. Install using
npm install -g react-native-cli. For help, please check this link.
- Latest Expo CLI should be installed. Install using
npm install -g expo-cli
If you want to see the app running on your system, then your system should be connected to a simulator which should be installed.
- If you are on a Mac machine, then you can simply install X-code and I-phone, where the simulators are automatically installed. Follow the guide on this link.
- If you are on a Windows machine, you will be able to test it properly on a Android Simulator which can be installed using Genymotion or Android Studio.
- Firebase Tools. Install using
npm install -g firebase-tools
Extract the bundle.zip folder. (Note -> If you copy the files from extracted folder, Do remember to copy the hidden files like .babelrc etc in app folder. Else you might face issues while starting the project.)
In the extracted directory, Go to app and Run
expo startto start the project using expo.
There are 2 ways to open this project on a simulator. You can even test it on real device using the expo web GUI that will be opened in your browser after step-2.
- Via Expo browser GUI - On the left side you will see 2 options, Run on ios and Run on android.
- Via command line - Click on the terminal and press i for ios simulator and a for android simulator
You can also run the development code on your mobile.
- In the Expo browser GUI on your system, click on publish/republish project. Remember, in order to reflect the requisite changes for internet based access, it is necessary to publish the project or the device should on the same network as the system on which expo is ran
- Install the expo app using App store/Play Store and open it.
- Click on Scan QR Code and scan the code showing on the Expo browser GUI on the left side in the terminal.
- The app should open on your mobile.
Hosting the webview file over the web (Optional - Only required for Phone, Github and Twitter Authentication or if you don't intend to use our web view URL) :
- Under components/CustomWebview, there is a index.html which will have to be hosted over any online hosting that you might have. This is neccesary to support Github,Twitter and Phone Authentication. To read why, Check this section. This is a one time process normally, But if you change the index.html, then make sure to push the changes online.
- Put the URL of the page under key WEBVIEW_URL in js/config/environment.js.
Firebase setup :
- Setup the the project in firebase by following instructions at this link.
- Go to the project in firebase console under the Authentication section on left sidebar and enable all sign in methods in Sign In Method Tab.
- Add the website url you used in step-4 in authorized domains at the bottom under Sign In Method Tab. Details
Configure Social Authentication for Google and Facebook by following the instructions in this section. (Optional - Required only if facebook and google authentication are to be enabled)
Deploy Cloud functions for sending push notifications via expo from firebase
npm run deployand follow on screen instructions if any to configure firebase app.
Go to firebase console-> Functions (From left sidebar) and verify that functions are created as per the screenshot. Note the URLs for each cloud function.
Testing Push Notifications
Open the project by following this scanning QR Code from step-5 in your mobile phone and signup.
Go to profile and note down the uid for sending push notifications.
Open the postman collection under
firebase-cloud-functions/postmanand update the URLs in the endpoints to match the URLs display in step-4.
Test that you are able to send push notification using Send Push Notifications Request.
If you still face any issues in setting up the projects, contact us, and we will get back to you as soon as possible.