Mobile App on the local machine
Firebase App
- Create a new Firebase app in your firebase console.
- Add the respective iOS and Android apps.
Use
io.market.nativebase.geekyants.taskman
as the package name & bundle identifier for Android & iOS. - Download GoogleService-Info.plist & google-services.json. Add GoogleService-Info.plist in MobileApp/ios/ TaskMan & google-services.json in MobileApp/android/app folder.
- Enable Authentication for Email/Password, Phone & Facebook (optional).
Deploying Functions
Generate new private key in firebase console (goto firebase console => project settings => service accounts
Goto Firebase folder and change project details in .firebaserc and firebase.js.
In case you are not able to figure out all data then you can add another app (Add Firebase to your web app) and copy the details.
In Firebase console go to Develop -> functions and click on Get started
and follow the instructions.
- In terminal goto Firebase/functions folder
- Run
npm i
- Create an account in Stripe and get the test key.
- Setup Stripe account and get api key. You can find the key here
- Goto Firebase folder and Run
firebase deploy
. - run
firebase functions:config:set stripe.testkey="YOUR_STRIPE_TEST_KEY"
Seed Database
- Go to Firebase console and enable Firestore.
- Go to Firebase folder and copy the rules from firestore.rule file to the Firebase console in Develop -> Storage -> rules
- Go to Firebase folder and then navigate to firestore-import-export folder and update serviceAccountKey.json along with database URL in the export.js file.
Enabling Storage
- Go to firebase/storage.rules and copy the rules to the Firebase console in Develop -> Storage -> rules, remove
if request.auth!=null
and replace it withif true
Mobile App
Installation steps
Note: Before starting the mobile app, you need to export the Firestore database. Follow Steps from API
Steps to initiate the app.
- Go to the MobileApp folder
- Type
npm i
- Go to ios folder run
pod install
(For running app on ios) - Follow the steps from here to configure Firebase in iOS and click here to do the same for Android
- Make sure you update the Firebase credentials in
MobileApp/src/firebase.js
with your app credentials. - If you are facing any issues or problems, follow these docs Steps to Create Fb App Id and making it live.
- To create FB app Id goto
https://developers.facebook.com/
. - Click on MyApps and click Create New App.
- To create new AppId place your project ID in the display name and enter your contact Email, click on create App ID.
- Goto settings/Basic/ and add Privacy Policy URL and click on save changes.
- Click the switch button on the top right corner and choose a category, and click submit to make the app live.
- In settings/Basic click on addPlatform and select Android. And provide Google Play Package Name, Class Name, Key Hashes.
- You can find Google Play Package Name, Class Name in your Android Manifest or your app's build.gradle file.
- And to generate Key Hashes, go to terminal and enter
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
- Copy Generated key hash and add it in Key hashes.
Make
Single Sign On
On. After adding this details click on 'SaveChanges'.In settings/Basic click on addPlatform and select IOS.
- Enter Bundle Id, iPhone store Id, Ipad Store Id and make "Single Sign-On" On and click on SaveChanges.
Go to MobileApp/src/utils/userutils.js add your_Google_Api_Key in apiKey variable
Open a code editor of your choice.
Add Facebook App Id for IOS: Navigate to
MobileApp/ios/TaskMan/Info.plist
line 28 replacefbAPP_ID
withfbYOUR_APPID
& line 35 and replaceAPP_ID
withYOUR_APP_ID
. For Android, navigate toMobileApp/android/app/src/main/res/values/strings.xml
line 4 and replaceAPP_ID
withYOUR_APP_ID
.Add local.properties file in android folder and write
sdk.dir="sdk path"
NOTE: Make sure to run the TaskMan.workspace project
If you are getting issue while pod install
delete podfile.lock
in mobileApp/ios folder & then retry with doing pod install
.
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 app on an iPhone simulator(MacOS), runreact-native run-ios
.Set Simulator Location- Go to Debug-> Location-> Custom Location->Enter
Latitude and Longitude
of your Current LocationIf you want to change the tasker radius, Go to
MobileApp->src->utils->config.js
and change thetaskerRadius
as per your requirements. By default the taskerRadius is 10 k.m.Go to MobileApp/src/utils/config.js add your_Google_Api_Key in apiKey variable
Note : Incase you are getting error for FBSDK follow the link and make sure that you have downloaded FBSDk for ios in Documents Folder .
Admin Webdashboard
Installation steps
Firebase Backend
In this guide, we aim to guide you in setting up the app under your own firebase account and updating the backend of the app. If you don't have one, you can create a firebase account here.
From there you can go tosettings -> Add Firebase to your web app
and copy the given code snippet inWebdashboard/react/src/index.js
.
const config = {
apiKey: "...",
authDomain: "...",
databaseURL: "...",
projectId: "...",
storageBucket: "",
messagingSenderId: "..."
};
…
- Go to the Webdashboard/react folder
- Type
npm i
- Run
npm start