Installing
Unzip the downloaded code from Code Canyon.
Using the terminal, issue the following command.
npm install
This will install all the required modules for your app.
Firebase
- Create an account in Firebase, it is free.
- Create new project
- Click on the "Web" icon
- Copy the config part
Put the copied values in App.js around line 15
One last thing. You should open you database for public usage
In your Firebase Databes, click on rules and make it look like this.
{
"rules": {
".read": "true",
".write": "true"
}
}
Your firebase is set it up now.
Now let's add the config files separatly for your android and ios app.
iOS
Click on Add firebase to your iOS app. Enter the bundle name of your app. By default is org.reactjs.native.example.RestaurantApp
. This can be changed to suit your needs but rememeber to also change in the xCode project later.
Download the GoogleService-info.plist
and place it in ios->Restaurant app
. Later you will drag-drop in your xCode project
Start the app
First you need to start the node server with this command
npm start
Soon as your node server is running you can start your app an preview it in simulator/emulator.
iPhone App
To run your iOS app on Mac
- Open the
ios
folder in your terminal and runpod install
cd ios
pod install
This should generate RestaurantApp.xcworkspace
file in the ios folder. Open that file (white icon).
Drag and Drop the GoogleService-info.plist file to your Restaurant app, and select copy if needed.
If you run into problems, check Common problems.
Now you can run the app in your simulator or on device.
Android App
To run your android app on Windows/Linux/Mac, you need first to set environment variable that points to your Android SDK folder
Example in Mac
export ANDROID_HOME=/Users/youruser/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Downloads google-services.json
from Firebase and put in android/app
Now run your app in emulator.
react-native run-android