Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Commit

Permalink
Upgrade to react-native-firebase v5.0.0 and react-native 0.57.1 (#61)
Browse files Browse the repository at this point in the history
* Upgrade to RN57.1

* Upgraded to latest Firebase dependencies

* Upgraded to react-native-firebase 5.0.0

* Removed package-lock.json (for those ppl that use yarn)

* Excluded lock files

* Fixed android build

* Updated index.js to default version

* Minor updates to sync the project as close to a fresh RN generated project as possible

* Disabled Invites pod on iOS because of misconfiguration exception

* Bump Crashlytics pods

* XCode 10 auto-added several AppIcon assets

* Auto updates of XCode 10 + removed Invites files

* Disabled new XCode 10 build system due to incompatibility issues which have not yet been resolved in RN57

* Added script to build Android APKs

* Revert back to RN 0.57.1, as 0.57.2 contains a regression causing the bundler to now work out of the box

facebook/react-native#21490

* [android] update firebase sdk versions

* [android] update to gradle v4.6

* replace old logo

* misc js changes
  • Loading branch information
IjzerenHein authored and Salakar committed Oct 11, 2018
1 parent c4840c0 commit c96fafc
Show file tree
Hide file tree
Showing 38 changed files with 659 additions and 10,243 deletions.
13 changes: 2 additions & 11 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
{
"presets": [
"babel-preset-react-native-stage-0/decorator-support"
],
"env": {
"development": {
"plugins": [
"transform-react-jsx-source"
]
}
}
}
"presets": ["module:metro-react-native-babel-preset"]
}
18 changes: 17 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,23 @@ node_modules/react-native/flow-github/
[options]
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.system=haste
module.system.haste.use_name_reducers=true
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip .ios suffix
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*

munge_underscores=true

Expand All @@ -51,4 +67,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[version]
^0.67.0
^0.78.0
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ buck-out/
/ios/Pods/
# google-services.json
# GoogleService-Info.plist

# RNFirebaseStarter
yarn.lock
package-lock.json
19 changes: 11 additions & 8 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@ import firebase from 'react-native-firebase';
export default class App extends React.Component {
constructor() {
super();
this.state = {
// firebase things?
};
this.state = {};
}

componentDidMount() {
// firebase things?
async componentDidMount() {
// TODO: You: Do firebase things
// const { user } = await firebase.auth().signInAnonymously();
// console.warn('User -> ', user.toJSON());

// await firebase.analytics().logEvent('foo', { bar: '123'});
}

render() {
return (
<ScrollView>
<View style={styles.container}>
<Image source={require('./assets/RNFirebase.png')} style={[styles.logo]}/>
<Image source={require('./assets/ReactNativeFirebase.png')} style={[styles.logo]}/>
<Text style={styles.welcome}>
Welcome to {'\n'} React Native Firebase
</Text>
Expand Down Expand Up @@ -71,8 +73,9 @@ const styles = StyleSheet.create({
logo: {
height: 120,
marginBottom: 16,
marginTop: 32,
width: 120,
marginTop: 64,
padding: 10,
width: 135,
},
welcome: {
fontSize: 20,
Expand Down
41 changes: 21 additions & 20 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@ android {
dexOptions {
javaMaxHeapSize "4g"
}
compileSdkVersion 27
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
applicationId "com.invertase.rnfirebasestarter"
minSdkVersion 18
targetSdkVersion 27
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
ndk {
Expand Down Expand Up @@ -157,33 +158,33 @@ dependencies {
transitive = false
}

implementation('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') {
implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {
transitive = true
}

// RNFirebase required dependencies
implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.firebase:firebase-core:16.0.4"
implementation "com.google.android.gms:play-services-base:16.0.1"

// RNFirebase optional dependencies
implementation "com.google.firebase:firebase-ads:15.0.1"
implementation "com.google.firebase:firebase-auth:16.0.2"
implementation "com.google.firebase:firebase-config:16.0.0"
implementation "com.google.firebase:firebase-crash:16.0.1"
implementation "com.google.firebase:firebase-database:16.0.1"
implementation "com.google.firebase:firebase-firestore:17.0.2"
implementation "com.google.firebase:firebase-functions:16.0.1"
implementation "com.google.firebase:firebase-invites:16.0.1"
implementation "com.google.firebase:firebase-storage:16.0.1"
implementation "com.google.firebase:firebase-messaging:17.1.0"
implementation "com.google.firebase:firebase-perf:16.0.0"

implementation "com.google.firebase:firebase-analytics:16.0.4"
implementation "com.google.firebase:firebase-auth:16.0.4"
implementation "com.google.firebase:firebase-config:16.0.1"
implementation "com.google.firebase:firebase-database:16.0.3"
implementation "com.google.firebase:firebase-firestore:17.1.1"
implementation "com.google.firebase:firebase-functions:16.1.1"
implementation "com.google.firebase:firebase-invites:16.0.4"
implementation "com.google.firebase:firebase-storage:16.0.3"
implementation "com.google.firebase:firebase-messaging:17.3.3"
implementation "com.google.firebase:firebase-perf:16.1.2"

//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
implementation "com.android.support:appcompat-v7:27.1.1"
implementation 'com.android.support:support-annotations:27.1.1'
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:support-annotations:${rootProject.ext.supportLibVersion}"

implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
}

// Run this once to be able to run the application with BUCK
Expand Down
53 changes: 0 additions & 53 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,56 +15,3 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Disabling obfuscation is useful if you collect stack traces from production crashes
# (unless you are using a system that supports de-obfuscate the stack traces).
-dontobfuscate

# React Native

# Keep our interfaces so they can be used by other ProGuard rules.
# See http://sourceforge.net/p/proguard/bugs/466/
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip

# Do not strip any method/class that is annotated with @DoNotStrip
-keep @com.facebook.proguard.annotations.DoNotStrip class *
-keep @com.facebook.common.internal.DoNotStrip class *
-keepclassmembers class * {
@com.facebook.proguard.annotations.DoNotStrip *;
@com.facebook.common.internal.DoNotStrip *;
}

-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
void set*(***);
*** get*();
}

-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }

-dontwarn com.facebook.react.**

# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
-dontwarn android.text.StaticLayout

# okhttp

-keepattributes Signature
-keepattributes *Annotation*
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**

# okio

-keep class sun.misc.Unsafe { *; }
-dontwarn java.nio.file.*
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn okio.**
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage;
import io.invertase.firebase.auth.RNFirebaseAuthPackage;
import io.invertase.firebase.config.RNFirebaseRemoteConfigPackage;
import io.invertase.firebase.crash.RNFirebaseCrashPackage;
import io.invertase.firebase.database.RNFirebaseDatabasePackage;
import io.invertase.firebase.fabric.crashlytics.RNFirebaseCrashlyticsPackage;
import io.invertase.firebase.firestore.RNFirebaseFirestorePackage;
Expand Down Expand Up @@ -50,7 +49,6 @@ protected List<ReactPackage> getPackages() {
new RNFirebaseAnalyticsPackage(),
new RNFirebaseAuthPackage(),
new RNFirebaseRemoteConfigPackage(),
new RNFirebaseCrashPackage(),
new RNFirebaseCrashlyticsPackage(),
new RNFirebaseDatabasePackage(),
new RNFirebaseFirestorePackage(),
Expand Down
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 34 additions & 23 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
google()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1'
classpath 'com.google.firebase:firebase-plugins:1.1.1'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
}
repositories {
jcenter()
google()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.0.1'
classpath 'com.google.firebase:firebase-plugins:1.1.5'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
mavenLocal()
jcenter()
google()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
google()
}
}

task wrapper(type: Wrapper) {
gradleVersion = '4.6'
distributionUrl = distributionUrl.replace("bin", "all")
}
Binary file modified android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Thu Oct 11 16:57:08 BST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
Loading

0 comments on commit c96fafc

Please sign in to comment.