From abf17d8d7fdb21ea9ff8e2205e9219cd12cd7453 Mon Sep 17 00:00:00 2001 From: Chris Bianca Date: Tue, 30 May 2017 16:16:56 +0100 Subject: [PATCH] [android] Split into separate packages for each strand of Firebase functionality --- .../invertase/firebase/RNFirebasePackage.java | 9 ---- .../admob/RNFirebaseAdMobPackage.java | 54 +++++++++++++++++++ .../analytics/RNFirebaseAnalyticsPackage.java | 51 ++++++++++++++++++ .../firebase/auth/RNFirebaseAuthPackage.java | 51 ++++++++++++++++++ .../config/RNFirebaseRemoteConfigPackage.java | 51 ++++++++++++++++++ .../crash/RNFirebaseCrashPackage.java | 51 ++++++++++++++++++ .../database/RNFirebaseDatabasePackage.java | 51 ++++++++++++++++++ .../messaging/RNFirebaseMessagingPackage.java | 51 ++++++++++++++++++ .../perf/RNFirebasePerformancePackage.java | 51 ++++++++++++++++++ .../storage/RNFirebaseStoragePackage.java | 51 ++++++++++++++++++ docs/installation-android.md | 52 +++++++++++++++--- tests/android/app/build.gradle | 18 ++++++- .../MainApplication.java | 20 ++++++- 13 files changed, 542 insertions(+), 19 deletions(-) create mode 100644 android/src/main/java/io/invertase/firebase/admob/RNFirebaseAdMobPackage.java create mode 100644 android/src/main/java/io/invertase/firebase/analytics/RNFirebaseAnalyticsPackage.java create mode 100644 android/src/main/java/io/invertase/firebase/auth/RNFirebaseAuthPackage.java create mode 100644 android/src/main/java/io/invertase/firebase/config/RNFirebaseRemoteConfigPackage.java create mode 100644 android/src/main/java/io/invertase/firebase/crash/RNFirebaseCrashPackage.java create mode 100644 android/src/main/java/io/invertase/firebase/database/RNFirebaseDatabasePackage.java create mode 100644 android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessagingPackage.java create mode 100644 android/src/main/java/io/invertase/firebase/perf/RNFirebasePerformancePackage.java create mode 100644 android/src/main/java/io/invertase/firebase/storage/RNFirebaseStoragePackage.java diff --git a/android/src/main/java/io/invertase/firebase/RNFirebasePackage.java b/android/src/main/java/io/invertase/firebase/RNFirebasePackage.java index 8f91ecfc..4f73ac54 100644 --- a/android/src/main/java/io/invertase/firebase/RNFirebasePackage.java +++ b/android/src/main/java/io/invertase/firebase/RNFirebasePackage.java @@ -40,15 +40,6 @@ public class RNFirebasePackage implements ReactPackage { public List createNativeModules(ReactApplicationContext reactContext) { List modules = new ArrayList<>(); modules.add(new RNFirebaseModule(reactContext)); - modules.add(new RNFirebaseAuth(reactContext)); - modules.add(new RNFirebaseDatabase(reactContext)); - modules.add(new RNFirebaseAnalytics(reactContext)); - modules.add(new RNFirebaseStorage(reactContext)); - modules.add(new RNFirebaseMessaging(reactContext)); - modules.add(new RNFirebaseCrash(reactContext)); - modules.add(new RNFirebaseRemoteConfig(reactContext)); - modules.add(new RNFirebasePerformance(reactContext)); - modules.add(new RNFirebaseAdMob(reactContext)); return modules; } diff --git a/android/src/main/java/io/invertase/firebase/admob/RNFirebaseAdMobPackage.java b/android/src/main/java/io/invertase/firebase/admob/RNFirebaseAdMobPackage.java new file mode 100644 index 00000000..a95cf194 --- /dev/null +++ b/android/src/main/java/io/invertase/firebase/admob/RNFirebaseAdMobPackage.java @@ -0,0 +1,54 @@ +package io.invertase.firebase.admob; + +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.JavaScriptModule; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.UIManagerModule; +import com.facebook.react.uimanager.ViewManager; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +@SuppressWarnings("unused") +public class RNFirebaseAdMobPackage implements ReactPackage { + public RNFirebaseAdMobPackage() { + } + + /** + * @param reactContext react application context that can be used to create modules + * @return list of native modules to register with the newly created catalyst instance + */ + @Override + public List createNativeModules(ReactApplicationContext reactContext) { + List modules = new ArrayList<>(); + modules.add(new RNFirebaseAdMob(reactContext)); + + return modules; + } + + /** + * @return list of JS modules to register with the newly created catalyst instance. + *

+ * IMPORTANT: Note that only modules that needs to be accessible from the native code should be + * listed here. Also listing a native module here doesn't imply that the JS implementation of it + * will be automatically included in the JS bundle. + */ + @Override + public List> createJSModules() { + return Collections.emptyList(); + } + + /** + * @param reactContext + * @return a list of view managers that should be registered with {@link UIManagerModule} + */ + @Override + public List createViewManagers(ReactApplicationContext reactContext) { + return Arrays.asList( + new RNFirebaseAdMobBanner() + ); + } +} diff --git a/android/src/main/java/io/invertase/firebase/analytics/RNFirebaseAnalyticsPackage.java b/android/src/main/java/io/invertase/firebase/analytics/RNFirebaseAnalyticsPackage.java new file mode 100644 index 00000000..9d15ea33 --- /dev/null +++ b/android/src/main/java/io/invertase/firebase/analytics/RNFirebaseAnalyticsPackage.java @@ -0,0 +1,51 @@ +package io.invertase.firebase.analytics; + +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.JavaScriptModule; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.UIManagerModule; +import com.facebook.react.uimanager.ViewManager; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +@SuppressWarnings("unused") +public class RNFirebaseAnalyticsPackage implements ReactPackage { + public RNFirebaseAnalyticsPackage() { + } + + /** + * @param reactContext react application context that can be used to create modules + * @return list of native modules to register with the newly created catalyst instance + */ + @Override + public List createNativeModules(ReactApplicationContext reactContext) { + List modules = new ArrayList<>(); + modules.add(new RNFirebaseAnalytics(reactContext)); + + return modules; + } + + /** + * @return list of JS modules to register with the newly created catalyst instance. + *

+ * IMPORTANT: Note that only modules that needs to be accessible from the native code should be + * listed here. Also listing a native module here doesn't imply that the JS implementation of it + * will be automatically included in the JS bundle. + */ + @Override + public List> createJSModules() { + return Collections.emptyList(); + } + + /** + * @param reactContext + * @return a list of view managers that should be registered with {@link UIManagerModule} + */ + @Override + public List createViewManagers(ReactApplicationContext reactContext) { + return Collections.emptyList(); + } +} diff --git a/android/src/main/java/io/invertase/firebase/auth/RNFirebaseAuthPackage.java b/android/src/main/java/io/invertase/firebase/auth/RNFirebaseAuthPackage.java new file mode 100644 index 00000000..4e5c79d4 --- /dev/null +++ b/android/src/main/java/io/invertase/firebase/auth/RNFirebaseAuthPackage.java @@ -0,0 +1,51 @@ +package io.invertase.firebase.auth; + +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.JavaScriptModule; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.UIManagerModule; +import com.facebook.react.uimanager.ViewManager; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +@SuppressWarnings("unused") +public class RNFirebaseAuthPackage implements ReactPackage { + public RNFirebaseAuthPackage() { + } + + /** + * @param reactContext react application context that can be used to create modules + * @return list of native modules to register with the newly created catalyst instance + */ + @Override + public List createNativeModules(ReactApplicationContext reactContext) { + List modules = new ArrayList<>(); + modules.add(new RNFirebaseAuth(reactContext)); + + return modules; + } + + /** + * @return list of JS modules to register with the newly created catalyst instance. + *

+ * IMPORTANT: Note that only modules that needs to be accessible from the native code should be + * listed here. Also listing a native module here doesn't imply that the JS implementation of it + * will be automatically included in the JS bundle. + */ + @Override + public List> createJSModules() { + return Collections.emptyList(); + } + + /** + * @param reactContext + * @return a list of view managers that should be registered with {@link UIManagerModule} + */ + @Override + public List createViewManagers(ReactApplicationContext reactContext) { + return Collections.emptyList(); + } +} diff --git a/android/src/main/java/io/invertase/firebase/config/RNFirebaseRemoteConfigPackage.java b/android/src/main/java/io/invertase/firebase/config/RNFirebaseRemoteConfigPackage.java new file mode 100644 index 00000000..57dd2350 --- /dev/null +++ b/android/src/main/java/io/invertase/firebase/config/RNFirebaseRemoteConfigPackage.java @@ -0,0 +1,51 @@ +package io.invertase.firebase.config; + +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.JavaScriptModule; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.UIManagerModule; +import com.facebook.react.uimanager.ViewManager; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +@SuppressWarnings("unused") +public class RNFirebaseRemoteConfigPackage implements ReactPackage { + public RNFirebaseRemoteConfigPackage() { + } + + /** + * @param reactContext react application context that can be used to create modules + * @return list of native modules to register with the newly created catalyst instance + */ + @Override + public List createNativeModules(ReactApplicationContext reactContext) { + List modules = new ArrayList<>(); + modules.add(new RNFirebaseRemoteConfig(reactContext)); + + return modules; + } + + /** + * @return list of JS modules to register with the newly created catalyst instance. + *

+ * IMPORTANT: Note that only modules that needs to be accessible from the native code should be + * listed here. Also listing a native module here doesn't imply that the JS implementation of it + * will be automatically included in the JS bundle. + */ + @Override + public List> createJSModules() { + return Collections.emptyList(); + } + + /** + * @param reactContext + * @return a list of view managers that should be registered with {@link UIManagerModule} + */ + @Override + public List createViewManagers(ReactApplicationContext reactContext) { + return Collections.emptyList(); + } +} diff --git a/android/src/main/java/io/invertase/firebase/crash/RNFirebaseCrashPackage.java b/android/src/main/java/io/invertase/firebase/crash/RNFirebaseCrashPackage.java new file mode 100644 index 00000000..898e551b --- /dev/null +++ b/android/src/main/java/io/invertase/firebase/crash/RNFirebaseCrashPackage.java @@ -0,0 +1,51 @@ +package io.invertase.firebase.crash; + +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.JavaScriptModule; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.UIManagerModule; +import com.facebook.react.uimanager.ViewManager; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +@SuppressWarnings("unused") +public class RNFirebaseCrashPackage implements ReactPackage { + public RNFirebaseCrashPackage() { + } + + /** + * @param reactContext react application context that can be used to create modules + * @return list of native modules to register with the newly created catalyst instance + */ + @Override + public List createNativeModules(ReactApplicationContext reactContext) { + List modules = new ArrayList<>(); + modules.add(new RNFirebaseCrash(reactContext)); + + return modules; + } + + /** + * @return list of JS modules to register with the newly created catalyst instance. + *

+ * IMPORTANT: Note that only modules that needs to be accessible from the native code should be + * listed here. Also listing a native module here doesn't imply that the JS implementation of it + * will be automatically included in the JS bundle. + */ + @Override + public List> createJSModules() { + return Collections.emptyList(); + } + + /** + * @param reactContext + * @return a list of view managers that should be registered with {@link UIManagerModule} + */ + @Override + public List createViewManagers(ReactApplicationContext reactContext) { + return Collections.emptyList(); + } +} diff --git a/android/src/main/java/io/invertase/firebase/database/RNFirebaseDatabasePackage.java b/android/src/main/java/io/invertase/firebase/database/RNFirebaseDatabasePackage.java new file mode 100644 index 00000000..3eff31fc --- /dev/null +++ b/android/src/main/java/io/invertase/firebase/database/RNFirebaseDatabasePackage.java @@ -0,0 +1,51 @@ +package io.invertase.firebase.database; + +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.JavaScriptModule; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.UIManagerModule; +import com.facebook.react.uimanager.ViewManager; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +@SuppressWarnings("unused") +public class RNFirebaseDatabasePackage implements ReactPackage { + public RNFirebaseDatabasePackage() { + } + + /** + * @param reactContext react application context that can be used to create modules + * @return list of native modules to register with the newly created catalyst instance + */ + @Override + public List createNativeModules(ReactApplicationContext reactContext) { + List modules = new ArrayList<>(); + modules.add(new RNFirebaseDatabase(reactContext)); + + return modules; + } + + /** + * @return list of JS modules to register with the newly created catalyst instance. + *

+ * IMPORTANT: Note that only modules that needs to be accessible from the native code should be + * listed here. Also listing a native module here doesn't imply that the JS implementation of it + * will be automatically included in the JS bundle. + */ + @Override + public List> createJSModules() { + return Collections.emptyList(); + } + + /** + * @param reactContext + * @return a list of view managers that should be registered with {@link UIManagerModule} + */ + @Override + public List createViewManagers(ReactApplicationContext reactContext) { + return Collections.emptyList(); + } +} diff --git a/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessagingPackage.java b/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessagingPackage.java new file mode 100644 index 00000000..a041740f --- /dev/null +++ b/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessagingPackage.java @@ -0,0 +1,51 @@ +package io.invertase.firebase.messaging; + +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.JavaScriptModule; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.UIManagerModule; +import com.facebook.react.uimanager.ViewManager; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +@SuppressWarnings("unused") +public class RNFirebaseMessagingPackage implements ReactPackage { + public RNFirebaseMessagingPackage() { + } + + /** + * @param reactContext react application context that can be used to create modules + * @return list of native modules to register with the newly created catalyst instance + */ + @Override + public List createNativeModules(ReactApplicationContext reactContext) { + List modules = new ArrayList<>(); + modules.add(new RNFirebaseMessaging(reactContext)); + + return modules; + } + + /** + * @return list of JS modules to register with the newly created catalyst instance. + *

+ * IMPORTANT: Note that only modules that needs to be accessible from the native code should be + * listed here. Also listing a native module here doesn't imply that the JS implementation of it + * will be automatically included in the JS bundle. + */ + @Override + public List> createJSModules() { + return Collections.emptyList(); + } + + /** + * @param reactContext + * @return a list of view managers that should be registered with {@link UIManagerModule} + */ + @Override + public List createViewManagers(ReactApplicationContext reactContext) { + return Collections.emptyList(); + } +} diff --git a/android/src/main/java/io/invertase/firebase/perf/RNFirebasePerformancePackage.java b/android/src/main/java/io/invertase/firebase/perf/RNFirebasePerformancePackage.java new file mode 100644 index 00000000..127af847 --- /dev/null +++ b/android/src/main/java/io/invertase/firebase/perf/RNFirebasePerformancePackage.java @@ -0,0 +1,51 @@ +package io.invertase.firebase.perf; + +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.JavaScriptModule; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.UIManagerModule; +import com.facebook.react.uimanager.ViewManager; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +@SuppressWarnings("unused") +public class RNFirebasePerformancePackage implements ReactPackage { + public RNFirebasePerformancePackage() { + } + + /** + * @param reactContext react application context that can be used to create modules + * @return list of native modules to register with the newly created catalyst instance + */ + @Override + public List createNativeModules(ReactApplicationContext reactContext) { + List modules = new ArrayList<>(); + modules.add(new RNFirebasePerformance(reactContext)); + + return modules; + } + + /** + * @return list of JS modules to register with the newly created catalyst instance. + *

+ * IMPORTANT: Note that only modules that needs to be accessible from the native code should be + * listed here. Also listing a native module here doesn't imply that the JS implementation of it + * will be automatically included in the JS bundle. + */ + @Override + public List> createJSModules() { + return Collections.emptyList(); + } + + /** + * @param reactContext + * @return a list of view managers that should be registered with {@link UIManagerModule} + */ + @Override + public List createViewManagers(ReactApplicationContext reactContext) { + return Collections.emptyList(); + } +} diff --git a/android/src/main/java/io/invertase/firebase/storage/RNFirebaseStoragePackage.java b/android/src/main/java/io/invertase/firebase/storage/RNFirebaseStoragePackage.java new file mode 100644 index 00000000..5e19d782 --- /dev/null +++ b/android/src/main/java/io/invertase/firebase/storage/RNFirebaseStoragePackage.java @@ -0,0 +1,51 @@ +package io.invertase.firebase.storage; + +import com.facebook.react.ReactPackage; +import com.facebook.react.bridge.JavaScriptModule; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.uimanager.UIManagerModule; +import com.facebook.react.uimanager.ViewManager; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +@SuppressWarnings("unused") +public class RNFirebaseStoragePackage implements ReactPackage { + public RNFirebaseStoragePackage() { + } + + /** + * @param reactContext react application context that can be used to create modules + * @return list of native modules to register with the newly created catalyst instance + */ + @Override + public List createNativeModules(ReactApplicationContext reactContext) { + List modules = new ArrayList<>(); + modules.add(new RNFirebaseStorage(reactContext)); + + return modules; + } + + /** + * @return list of JS modules to register with the newly created catalyst instance. + *

+ * IMPORTANT: Note that only modules that needs to be accessible from the native code should be + * listed here. Also listing a native module here doesn't imply that the JS implementation of it + * will be automatically included in the JS bundle. + */ + @Override + public List> createJSModules() { + return Collections.emptyList(); + } + + /** + * @param reactContext + * @return a list of view managers that should be registered with {@link UIManagerModule} + */ + @Override + public List createViewManagers(ReactApplicationContext reactContext) { + return Collections.emptyList(); + } +} diff --git a/docs/installation-android.md b/docs/installation-android.md index 9c777eb7..0832f464 100644 --- a/docs/installation-android.md +++ b/docs/installation-android.md @@ -25,12 +25,25 @@ apply plugin: 'com.google.gms.google-services' ## 2) Link RNFirebase -To install `react-native-firebase` in your project, you'll need to import the package from `io.invertase.firebase` in your project's `android/app/src/main/java/com/[app name]/MainApplication.java` and list it as a package for ReactNative in the `getPackages()` function: +RNFirebase is split into separate modules to allow you to only include the Firebase functionality that you need in your application. + +To install `react-native-firebase` in your project, you'll need to import the packages you need from `io.invertase.firebase` in your project's `android/app/src/main/java/com/[app name]/MainApplication.java` and list them as packages for ReactNative in the `getPackages()` function: ```java package com.youcompany.application; // ... -import io.invertase.firebase.RNFirebasePackage; +// Required package +import io.invertase.firebase.RNFirebasePackage; // <-- Add this line +// Optional packages - add as appropriate +import io.invertase.firebase.admob.RNFirebaseAdMobPackage; //Firebase AdMob +import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage; // Firebase Analytics +import io.invertase.firebase.auth.RNFirebaseAuthPackage; // Firebase Auth +import io.invertase.firebase.config.RNFirebaseRemoteConfigPackage; // Firebase Remote Config +import io.invertase.firebase.crash.RNFirebaseCrashPackage; // Firebase Crash Reporting +import io.invertase.firebase.database.RNFirebaseDatabasePackage; // Firebase Realtime Database +import io.invertase.firebase.messaging.RNFirebaseMessagingPackage; // Firebase Cloud Messaging +import io.invertase.firebase.perf.RNFirebasePerformancePackage; // Firebase Messaging +import io.invertase.firebase.storage.RNFirebaseStoragePackage; // Firebase Storage // ... public class MainApplication extends Application implements ReactApplication { // ... @@ -39,18 +52,43 @@ public class MainApplication extends Application implements ReactApplication { protected List getPackages() { return Arrays.asList( new MainReactPackage(), - new RNFirebasePackage() // <-- Add this line + new RNFirebasePackage(), // <-- Add this line + // Add these packages as appropriate + new RNFirebaseAdMobPackage(), + new RNFirebaseAnalyticsPackage(), + new RNFirebaseAuthPackage(), + new RNFirebaseRemoteConfigPackage(), + new RNFirebaseCrashPackage(), + new RNFirebaseDatabasePackage(), + new RNFirebaseMessagingPackage(), + new RNFirebasePerformancePackage(), + new RNFirebaseStoragePackage() ); } }; // ... } ``` -You'll also need to list it in our `android/app/build.gradle` file as a dependency that we want React Native to compile. In the `dependencies` listing, add the `compile` line: +You'll also need to include RNFirebase and the required Firebase dependencies in our `android/app/build.gradle` so that they are compiled as part of React Native. In the `dependencies` listing, add the appropriate `compile` lines: -```java +``` dependencies { - compile project(':react-native-firebase') + # RNFirebase Required dependencies + compile(project(':react-native-firebase')) { + transitive = false + } + compile "com.google.firebase:firebase-core:$firebaseVersion" + + # RNFirebase optional dependencies + compile "com.google.firebase:firebase-ads:$firebaseVersion" + compile "com.google.firebase:firebase-analytics:$firebaseVersion" + compile "com.google.firebase:firebase-auth:$firebaseVersion" + compile "com.google.firebase:firebase-config:$firebaseVersion" + compile "com.google.firebase:firebase-crash:$firebaseVersion" + compile "com.google.firebase:firebase-database:$firebaseVersion" + compile "com.google.firebase:firebase-messaging:$firebaseVersion" + compile "com.google.firebase:firebase-perf:$firebaseVersion" + compile "com.google.firebase:firebase-storage:$firebaseVersion" } ``` @@ -112,7 +150,7 @@ If you would like to schedule local notifications then you also need to add the ``` -## 3) Performance Monitoring (optional) +## 4) Performance Monitoring (optional) If you'd like to take advantage of Firebases [Performance Monitoring](https://firebase.google.com/docs/perf-mon/), the following additions to your project setup are required: diff --git a/tests/android/app/build.gradle b/tests/android/app/build.gradle index 4d51fce3..4da97285 100644 --- a/tests/android/app/build.gradle +++ b/tests/android/app/build.gradle @@ -127,11 +127,25 @@ android { } } +project.ext.firebaseVersion = '10.2.6' + dependencies { - compile project(':react-native-firebase') + compile(project(':react-native-firebase')) { + transitive = false + } compile project(':react-native-vector-icons') compile fileTree(dir: "libs", include: ["*.jar"]) - compile "com.google.firebase:firebase-perf:10.2.6" + compile "com.google.android.gms:play-services-base:$firebaseVersion" + compile "com.google.firebase:firebase-ads:$firebaseVersion" + compile "com.google.firebase:firebase-analytics:$firebaseVersion" + compile "com.google.firebase:firebase-auth:$firebaseVersion" + compile "com.google.firebase:firebase-config:$firebaseVersion" + compile "com.google.firebase:firebase-core:$firebaseVersion" + compile "com.google.firebase:firebase-crash:$firebaseVersion" + compile "com.google.firebase:firebase-database:$firebaseVersion" + compile "com.google.firebase:firebase-messaging:$firebaseVersion" + compile "com.google.firebase:firebase-perf:$firebaseVersion" + compile "com.google.firebase:firebase-storage:$firebaseVersion" compile "com.android.support:appcompat-v7:24.0.0" compile "com.facebook.react:react-native:+" // From node_modules } diff --git a/tests/android/app/src/main/java/com/reactnativefirebasedemo/MainApplication.java b/tests/android/app/src/main/java/com/reactnativefirebasedemo/MainApplication.java index 23030ecd..68af9279 100644 --- a/tests/android/app/src/main/java/com/reactnativefirebasedemo/MainApplication.java +++ b/tests/android/app/src/main/java/com/reactnativefirebasedemo/MainApplication.java @@ -4,6 +4,15 @@ import android.app.Application; import com.facebook.react.ReactApplication; import io.invertase.firebase.RNFirebasePackage; +import io.invertase.firebase.admob.RNFirebaseAdMobPackage; +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.messaging.RNFirebaseMessagingPackage; +import io.invertase.firebase.perf.RNFirebasePerformancePackage; +import io.invertase.firebase.storage.RNFirebaseStoragePackage; import com.oblador.vectoricons.VectorIconsPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; @@ -26,7 +35,16 @@ public class MainApplication extends Application implements ReactApplication { return Arrays.asList( new MainReactPackage(), new VectorIconsPackage(), - new RNFirebasePackage() + new RNFirebasePackage(), + new RNFirebaseAdMobPackage(), + new RNFirebaseAnalyticsPackage(), + new RNFirebaseAuthPackage(), + new RNFirebaseRemoteConfigPackage(), + new RNFirebaseCrashPackage(), + new RNFirebaseDatabasePackage(), + new RNFirebaseMessagingPackage(), + new RNFirebasePerformancePackage(), + new RNFirebaseStoragePackage() ); } };