diff --git a/app b/app index 430fc1a6..68d99ac6 160000 --- a/app +++ b/app @@ -1 +1 @@ -Subproject commit 430fc1a66106efc99513eeae8043910bc40c0b82 +Subproject commit 68d99ac639b908f6011325140c3a37428d039ad9 diff --git a/src/main/java/io/lbry/browser/reactmodules/FirebaseModule.java b/src/main/java/io/lbry/browser/reactmodules/FirebaseModule.java index a48bb996..38839a45 100644 --- a/src/main/java/io/lbry/browser/reactmodules/FirebaseModule.java +++ b/src/main/java/io/lbry/browser/reactmodules/FirebaseModule.java @@ -1,9 +1,11 @@ package io.lbry.browser.reactmodules; +import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.widget.Toast; +import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; @@ -37,10 +39,16 @@ public class FirebaseModule extends ReactContextBaseJavaModule { } @ReactMethod - public void setCurrentScreen(String name) { - if (firebaseAnalytics != null) { - firebaseAnalytics.setCurrentScreen(MainActivity.getActivity(), name, Utils.capitalizeAndStrip(name)); + public void setCurrentScreen(String name, final Promise promise) { + final Activity activity = getCurrentActivity(); + if (activity != null && firebaseAnalytics != null) { + activity.runOnUiThread(new Runnable() { + public void run() { + firebaseAnalytics.setCurrentScreen(activity, name, Utils.capitalizeAndStrip(name)); + } + }); } + promise.resolve(true); } @ReactMethod