All Projects → bitcoinvsalts → react-native-firebase-starter

bitcoinvsalts / react-native-firebase-starter

Licence: MIT License
The ultimate React Native starter using Firebase, Mobx, CodePush, OneSignal made with ♥

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
objective c
16641 projects - #2 most used programming language
java
68154 projects - #9 most used programming language
python
139335 projects - #7 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to react-native-firebase-starter

React Native Firebase Starter
The ultimate React Native starter using Firebase, Mobx, CodePush, OneSignal made with ♥
Stars: ✭ 289 (-0.34%)
Mutual labels:  mobx, onesignal
OneSignal-WordPress-Plugin
OneSignal is a free push notification service for web and mobile apps. This plugin makes it easy to integrate your website with OneSignal Push Notifications. https://onesignal.com
Stars: ✭ 71 (-75.52%)
Mutual labels:  onesignal
mobile-realm
mobile-realm
Stars: ✭ 21 (-92.76%)
Mutual labels:  mobx
browsear
A Chrome extension to search a song like Shazam
Stars: ✭ 20 (-93.1%)
Mutual labels:  mobx
lens
The official network explorer for Wavelet.
Stars: ✭ 28 (-90.34%)
Mutual labels:  mobx
docker-ui
Web UI For managing Docker images, containers, volumes, and networks
Stars: ✭ 45 (-84.48%)
Mutual labels:  mobx
React-Native-Demo
No description or website provided.
Stars: ✭ 25 (-91.38%)
Mutual labels:  mobx
plantapp
A React + MobX app for Plants data from USDA
Stars: ✭ 13 (-95.52%)
Mutual labels:  mobx
egg-react-mobx-demo
A simple todo list demo of using Egg.js, React and MobX.
Stars: ✭ 15 (-94.83%)
Mutual labels:  mobx
over-hangman
💥 Over powered hangman game
Stars: ✭ 42 (-85.52%)
Mutual labels:  mobx
ReactNativeStudy
react native study
Stars: ✭ 63 (-78.28%)
Mutual labels:  codepush
yunle-template-react-native
yunle-cli 前端开发模板- RN 专为react-native开发 IOS&Android APP
Stars: ✭ 14 (-95.17%)
Mutual labels:  codepush
311
New web portal for BOS:311
Stars: ✭ 15 (-94.83%)
Mutual labels:  mobx
react-native-navigation-mobx-demo
React native Navigation with MobX demo. Blog post write up ->
Stars: ✭ 32 (-88.97%)
Mutual labels:  mobx
frontend-handbook
Our handbook based on 10 years of experience in Frontend/JS development
Stars: ✭ 45 (-84.48%)
Mutual labels:  mobx
loki-admin
Admin app build by KokiUI
Stars: ✭ 13 (-95.52%)
Mutual labels:  mobx
team-timesheets
Time tracking web app built as a replacement for old school timesheets.
Stars: ✭ 25 (-91.38%)
Mutual labels:  mobx
boring-router
A type-safe MobX router with parallel routing support.
Stars: ✭ 74 (-74.48%)
Mutual labels:  mobx
react-typescript
A Front-End Project with Typescript/Antd. webpack5+react-router4+antd+typescript4+grahql
Stars: ✭ 63 (-78.28%)
Mutual labels:  mobx
BXStage
基于mobx + react 构建一个60多个页面大型跨平台 react-naive 应用
Stars: ✭ 49 (-83.1%)
Mutual labels:  mobx

The ultimate React Native starter using Firebase, Mobx, Code-Push and OneSignal

Preview

Download the app on your phone directly

iOS app Android app

Build your own Instagram + WhatsApp + chat marketplace mobile app clone with push notifications and code deployment integrated

Built with

  • React Native : One language, JavaScript, one source code.
  • MobX : Simple, scalable state management (easier than Redux)
  • Firebase : Cloud based database and storage service
  • CodePush : Push code updates to your apps, instantly
  • OneSignal : Unlimited push notifications‎

How to install the app?

Prerequisites

To create your own copy of this application, here are the prerequisites:

  • Yarn installed on your system or simply use npm if you prefer.
  • React Native installed on your system.
  • Android SDK installed to run the app on android devices.
  • Xcode installed to test the app on iOS devices or simulator.

Build your own copy

Clone the repository:

git clone https://github.com/jsappme/react-native-firebase-starter.git NewApp
cd NewApp

Let's install all the dependencies:

yarn

In order to run the app you have to setup Firebase (CodePush and OneSignal are optional).

Firebase Setup:

After Login or Register at https://firebase.google.com/

Go to your Firebase console: https://console.firebase.google.com/

Create a new project and click on Add Firebase to your web app.

Open the Firebase config file using your favorite editor (in my case Atom) and Copy/Paste your Firebase variables:

atom src/firebase.js

Next setup the Firebase Auth by enabling Email/Password Signup method: https://console.firebase.google.com/project/newapp/authentication/providers

Copy and Paste your Firebase rules at: https://console.firebase.google.com/project/newapp/database/rules

{
  "rules": {
    ".read": "auth != null",
    ".write": "auth != null",
    "usernameList" : {
      ".read": true
    },
    "posts": {
        ".indexOn": "createdAt",
        ".read": true
    },
    "user_posts": {
      "$uid": {
        "posts": {
          ".indexOn": "createdAt"
        },
      },
    },
    "user_orders": {
      "$uid": {
        "posts": {
          ".indexOn": "createdAt"
        },
      },
    },
    "user_chats": {
      "$uid": {
        "posts": {
          ".indexOn": "updatedAt"
        },
      },
    },
  }
}

That's it for Firebase!

Make sure all the packages are linked to React Native:

react-native link

###We are now ready to lunch the app on an android device.

react-native run-android

To see the logs:

react-native log-android

###To open the app on Xcode:

yarn run ios

You might need to add a Signing Team for MyApp and MyApptest to build it.

###To run the app on an iOS simulator:

react-native run-ios

To see the logs:

react-native log-ios

OneSignal Setup for the Push Notification

With the help from this great article by Spencer Carli: https://medium.com/differential/react-native-push-notifications-with-onesignal-9db6a7d75e1e#.dwpff7u2z

If you want to enable Push Notification, you will need to choose an Explicit App ID (a.k.a Product Bundle Identifier in iOS) for your app. The App Id of this demo app is me.jsapp.myapp. In order to change it, you need to find and replace all the instances of myapp and MyApp with your new App Id in the file names and in the content of all the files in the NewApp folder while respecting the case sensitivity. Example: myapp to newapp and MyApp to NewApp. If you change the prefix of the App ID me.jsapp to something else, you need to change the folder structure in android/app/src/main/java.

Login or Register at https://onesignal.com

Add new app and select the Android platform first

Preview

Open a new tab and go to your Firebase app Settings > CLOUD MESSAGING: https://console.firebase.google.com/project/newapp/settings/cloudmessaging

Preview

Save the two values listed:

  • Server key, a.k.a the Google Server API key
  • Sender ID, a.k.a the Google Project Number a.k.a my_onesignal_google_project_number (you will need it later)*

Copy/Paste those two values on the first tab: OneSignal > Google Android (GCM) Configuration and Save it

Preview

Let's configure the iOS platform by clicking on Configure next to Apple iOS in NewApp > App Settings

Preview

Open a new tab and create our app within the Apple Developer portal

Preview

Enter the Explicit App ID of the app, in this case, me.jsapp.newapp.

Next enable Push Notifications for the app.

Preview

Now let's create the provisioning profile. OneSignal has a tool called The Provisionator that will help with this process.

Sign into your account and make sure you choose the proper team

Preview

After pressing Next, you’ll see something like this

Preview

Download those files and remember the password for the p12 file. Then head back to OneSignal tab, upload the file, enter your password and Save

Preview

####Your Push Notification platforms are now set up. Now we can actually work on integrating this with our app.

On your browser, go to OneSignal > NewApp > App Settings > Keys & IDs and copy the two values:

  • OneSignal App ID a.k.a. my_onesignal_app_id
  • REST API Key a.k.a. my_onesignal_api_key

Edit, Find and Replace these strings by their values into the following files:

  • my_onesignal_google_project_number in:
atom android/app/build.gradle
  • my_onesignal_app_id in:
atom android/app/build.gradle
atom ios/NewApp/AppDelegate.m
atom src/store/AppStore.js
  • my_onesignal_api_key in:
atom src/store/AppStore.js

That's it for the push notification configuration.

CodePush Setup for Code Deployment

Why CodePush? I am a CodePusher and I love it. Thanks MS and not M$ anymore

Install the CodePush CLI https://microsoft.github.io/code-push/index.html#getting_started

npm install -g code-push-cli

Create a CodePush account or Login if you have one already.

code-push register

or

code-push login

Register your app with the service, create one for each platform.

code-push app add newapp-and
code-push app add newapp-ios

Copy/Paste these Staging deployment keys to their respective platform files:

my_codepush_android_key in

atom android/app/src/main/res/values/strings.xml

my_codepush_ios_key in

atom ios/NewApp/Info.plist

Google Analytics Setup

Edit the Google Analytics Tracker variable:

atom src/store/AppStore.js

This app is only a starter. Now it's time for some customizations and improvements.

##License MIT License. Do whatever you want to do.

Credits

All the credits goes to all library creators and contributors to the open source repositories and libraries that I am using. I'm very grateful to all of them. Here are some of them:

I really appreciate any suggestions, feedback, PRs and issues.

Made with by JSapp.me

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].