App Setup
here come the steps to create your backends, deploy the API, and get your endpoints
Last updated
Was this helpful?
here come the steps to create your backends, deploy the API, and get your endpoints
Last updated
Was this helpful?
Head over to Firebase.com and create a new account. Once logged in, you’ll be able to create a new project in the Firebase Console.
Create a new account on Firebase.com
Create a new project in Firebase Console
Enable Phone, Google & Facebook auth method in Firebase Console -> Authentication -> Sign-in method
Create a new iOS app, with App ID com.example
Create a new Android app with package name com.example
Download the configuration file generated at the next step to your computer (GoogleService-Info.plist for iOS, and google-services.json for Android)
Create database from Cloud Firestore
Create a cloudinary app for media uploading. https://cloudinary.com/documentation/how_to_integrate_cloudinary
Create a stripe account for the payment gateway. https://www.paulisystems.net/how-to-create-a-stripe-account-for-online-payment-processing/?cn-reloaded=1
Steps to initiate the app.
Go to the App folder
Type on terminal: npm install
Open a code editor of your choice.
Go to src/config/config.js
. Update
WEB_CLIENT
with YOUR_WEB_CLIENT
(Get this value from Firebase console > Authenication > Sign in Method > Google > Web SDK Configuration)
CLOUDINARY_PRESENT_NAME,
with YOUR_CLOUDINARY_PRESENT_NAME
(Get this value from Cloudinary dashboard > Settings > Upload > Upload presents)
CLOUDINARY_CLOUD_NAME
with YOUR_CLOUDINARY_CLOUD_NAME
(Get this value from Cloudinary dashboard)
STRIPE_PUBLIC_KEY
with YOUR_STRIPE_PUBLIC_KEY
(Get this value from Stripe dashboard > Developers > API keys)
STRIPE_CLOUD_SERVER_URL
with YOUR_STRIPE_CLOUD_SERVER_URL
(Get this value from below How to get stripe cloud URL)
IS_STRIPE_LIVE
set true
and false
(Set true if you use live STRIPE_PUBLIC_KEY
otherwise false)
Facebook Setup On Android and iOS
iOS:
1) Navigate to ios
folder
2) Navigate Epicbae/Info.plist
replace the value
of FacebookAppID
and FacebookDisplayName
with YourFacebookAppID
& YourFacebookDisplayName
Android:
1) Navigate to android
folder
2) Navigate app/src/main/res/values/strings.xml
replace the value
of facebook_app_id
and fb_login_protocol_schema
with yourfacebook_app_id
& yourfb_login_protocol_schema
Firebase Setup on Android and iOS
iOS:
1) Navigate to ios/Epicbae
folder
2) Added GoogleService-Info.plist
file to project
Android:
1) Navigate to android/app
folder
2) Added google-services.json
file to project
If you would like to run the app in Android, you need to connect an Android phone to a system or you can run the app on an Android emulator. Type react-native run-android
Make sure that you have configured the AVD before running the command. If you would like to run the app on an iPhone simulator(MacOS), run react-native run-ios
.
NOTE: Make sure you run the Epicbae.xcworkspace project
We then need to install the firebase-tools package globally using NPM.
$ npm install -g firebase-tools
Now we have firebase-tools installed, we should log in to our firebase account and initiate a new project in our project directory. You will get a choice of which services you would like to use — you only need to select ‘Functions’ here for now.
$ firebase login
$ firebase init
Let’s move into the functions folder.
$ npm install
We can then deploy our function and get our endpoint (Function URL in output in screenshot).
$ firebase deploy --only functions
Additional Information 1) Here is Facebook Authentication Step for Integration on iOS and Android https://firebase.google.com/docs/auth/?authuser=0 2) Here is Stripe payment with Firebase Cloud function tutorial https://medium.com/enappd/stripe-payment-integration-in-react-native-apps-using-firebase-926c3b1f1448