[React Native ] - All of things
May 29, 2020 |React Native
==================================================================
BASIC
==================================================================
REACT REDUX
1. Promise data in store
==================================================================
1. Facebook Login
$ yarn add react-native-fbsdk-next
OR npm
$ npm install --save react-native-fbsdk-next
OR npm
$ npm install --save react-native-fbsdk-next
2. Change Emulated Performance - Graphics
- Go to Android > Show on Disk:
hw.gpu.enabled = yes
hw.gpu.mode = host //Host: use Hardware
or
hw.gpu.mode=software (or hardware)
hw.gpu.mode=software (or hardware)
3. How to resolve issue related FLAG_IMMUTABLE
Decription: Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
4. Google SignIn SDK is failing by throwing error, A non-recoverable sign in failure occurred -catch error: React Native
Step 1: cd ./android && ./gradlew signingReport
Step 2: Copy SHA1 of Task :app:signingReport, Variant: debugAndroidTest, Config: debug
Step 3: Update it the Firebase Console under Project Settings, Android app, add the SHA1
Step 4: Download the google-services.json, put it in ./android/app
Step 6: Take the Web client ID and use that for your GoogleSignin.configure({ webClientId: ... });
Step 7: This Web client ID should be the same as listed in https://console.developers.google.com/apis/credentials?project=<your_project_id> -> Credentials -> OAuth 2 Client ID -> Web Client
5. Check Realm DB Version for Compatible React Native
6. Enable Proguard
Run Proguard to shrink the Java bytecode in release builds.
edit in app/build.gradle
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = true
It will be some error when enable this while run app. Add more to proguard-rules.pro :
# Add any project specific keep options here:
-keep class io.realm.** { * ; }
-keep class com.swmansion.reanimated.** { *; }
-keep class com.facebook.hermes.unicode.** { *; }
-keep class com.facebook.jni.** { *; }
-keep class com.facebook.react.turbomodule.** { *; }
-keep public class com.horcrux.svg.** {*;}
is updating...