Skip to content

Instantly share code, notes, and snippets.

@robertov8
Last active January 8, 2018 18:37
Show Gist options
  • Save robertov8/430520e0be1aec5793ad9bd5c0e1c983 to your computer and use it in GitHub Desktop.
Save robertov8/430520e0be1aec5793ad9bd5c0e1c983 to your computer and use it in GitHub Desktop.
Stack React

React Native

React

$ npm install -g react-native-cli
$ react-native
https://facebook.github.io/react-native/docs/getting-started.html

Generating Signed APK

https://facebook.github.io/react-native/docs/signed-apk-android.html

cd android/app
keytool -genkey -v -keystore projectname.keystore -alias projectname -keyalg RSA -keysize 2048 -validity 10000

nano ~/.gradle/gradle.properties
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****

# android/app/build.gradle
...
android {
    ...
    defaultConfig { ... }
    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
    }
    buildTypes {
        release {
            ...
            signingConfig signingConfigs.release
        }
    }
}
...

# Generating the release APK
cd android && ./gradlew assembleRelease
adb install app/build/outputs/apk/app-release.apk
# OR
react-native run-android --variant=release

Eslint

npm i --save-dev eslint eslint-plugin-react

Redux

npm i --save react-redux redux
http://redux.js.org/

npm i --save redux-thunk
https://github.com/gaearon/redux-thunk

npm i --save-dev redux-logger
https://github.com/evgenyrodionov/redux-logger

Router

https://reactnavigation.org/

npm install --save react-navigation

Firebase - vX.X.X

https://github.com/invertase/react-native-firebase

npm install --save firebase
npm install --save react-native-firebase

# Generate SHA1
keytool -exportcert -list -v -alias MYAPP -keystore android/app/MYAPP.keystore
https://console.firebase.google.com/project/pojectname/settings/general/

Provider

GoogleSignIn

https://github.com/devfd/react-native-google-signin

npm install react-native-google-signin --save
react-native link react-native-google-signin

# Err multiDex - android/app/build.gradle
android {
    defaultConfig {
        multiDexEnabled true  // this line will solve this problem
    }
}

# https://console.firebase.google.com/project/project/authentication/providers
GoogleSignin.configure({ webClientId:  'ID do cliente da Web' });

FBSDK

https://github.com/facebook/react-native-fbsdk

npm install react-native-fbsdk@0.6.0 --save
react-native link react-native-fbsdk

https://developers.facebook.com/docs/android/getting-started/
# Quick Start
Produtos -> Login do Facebook -> Configurações 

URIs de redirecionamento do OAuth válidos
* Login do OAuth no navegador incorporado - Sim
* URIs de redirecionamento do OAuth válidos
    * https://firebaseappexample.firebaseapp.com/__/auth/handler
    * firebaseappexample.firebaseapp.com

Produtos -> Login do Facebook -> Início rápido  || Configurações -> Básico -> Adicionar plataforma -> Android
Nome do pacote do Google Play: com.app
Nome da classe: com.app.MainActivity
Hashes chave: (keytool -exportcert -alias app -keystore android/app/app.keystore | openssl sha1 -binary | openssl base64)

# Add Facebook App ID

# Fix Error Remove Line 61 - @Override
node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/FBSDKPackage.java

UI

https://docs.nativebase.io/docs/GetStarted.html

npm install native-base --save
react-native link

Utils

https://github.com/chriso/validator.js

npm install --save validator

Stack

React

$ npm install -g create-react-app
$ create-react-app
https://facebook.github.io/react/docs/installation.html

* react
* react-dom
* react-scripts

Eslint

npm i --save-dev eslint eslint-plugin-react

Redux

npm i --save react-redux redux
http://redux.js.org/

npm i --save redux-thunk
https://github.com/gaearon/redux-thunk

Router

https://reacttraining.com/react-router/web/example/basic

npm install --save react-router-dom

Firebase

npm install --save firebase

Utils

npm install --save lodash
https://lodash.com/

npm install --save base-64
https://www.npmjs.com/package/base-64

UI

http://materializecss.com/getting-started.html

npm install --save materialize-css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment