App Setup
here come the steps to create your backends, deploy the API, and get your endpoints
Firebase Configuration
1. Create a Firebase Project
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
2. Create a Cloudinary Account
Create a cloudinary app for media uploading. https://cloudinary.com/documentation/how_to_integrate_cloudinary
3. Create a Stripe Account
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
Mobile App Configuration
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
. UpdateWEB_CLIENT
withYOUR_WEB_CLIENT
(Get this value from Firebase console > Authenication > Sign in Method > Google > Web SDK Configuration)CLOUDINARY_PRESENT_NAME,
withYOUR_CLOUDINARY_PRESENT_NAME
(Get this value from Cloudinary dashboard > Settings > Upload > Upload presents)CLOUDINARY_CLOUD_NAME
withYOUR_CLOUDINARY_CLOUD_NAME
(Get this value from Cloudinary dashboard)STRIPE_PUBLIC_KEY
withYOUR_STRIPE_PUBLIC_KEY
(Get this value from Stripe dashboard > Developers > API keys)STRIPE_CLOUD_SERVER_URL
withYOUR_STRIPE_CLOUD_SERVER_URL
(Get this value from below How to get stripe cloud URL)IS_STRIPE_LIVE
settrue
andfalse
(Set true if you use liveSTRIPE_PUBLIC_KEY
otherwise false)Facebook Setup On Android and iOS iOS: 1) Navigate to
ios
folder 2) NavigateEpicbae/Info.plist
replace thevalue
ofFacebookAppID
andFacebookDisplayName
withYourFacebookAppID
&YourFacebookDisplayName
Android: 1) Navigate toandroid
folder 2) Navigateapp/src/main/res/values/strings.xml
replace thevalue
offacebook_app_id
andfb_login_protocol_schema
withyourfacebook_app_id
&yourfb_login_protocol_schema
Firebase Setup on Android and iOS iOS: 1) Navigate to
ios/Epicbae
folder 2) AddedGoogleService-Info.plist
file to project Android: 1) Navigate toandroid/app
folder 2) Addedgoogle-services.json
file to projectIf 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), runreact-native run-ios
. NOTE: Make sure you run the Epicbae.xcworkspace project
2. How to get stripe cloud URL
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
Last updated