diff --git a/.gitignore b/.gitignore index 012766ba..47509c25 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,6 @@ src/main/assets/index.android.bundle.meta .vagrant lbry-android.keystore +p4a/pythonforandroid/bootstraps/lbry/build/templates/google-services.json .gitsecret/keys/random_seed + diff --git a/.gitsecret/paths/mapping.cfg b/.gitsecret/paths/mapping.cfg index dba90436..3c5cb735 100644 --- a/.gitsecret/paths/mapping.cfg +++ b/.gitsecret/paths/mapping.cfg @@ -1 +1,2 @@ lbry-android.keystore: +p4a/pythonforandroid/bootstraps/lbry/build/templates/google-services.json diff --git a/app/package-lock.json b/app/package-lock.json index 1a8c2474..d51fbf6c 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -956,11 +956,11 @@ "integrity": "sha1-p4di+9rftSl76ZsV01p4Wy8JW/c=" }, "accepts": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.6.tgz", - "integrity": "sha512-QsaoUD2dpVpjENy8JFpQnXP9vyzoZPmAoKrE3S6HtSB7qzSebkJNnmdY4p004FQUSSiHXPueENpoeuUW/7a8Ig==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "requires": { - "mime-types": "~2.1.24", + "mime-types": "~2.1.18", "negotiator": "0.6.1" } }, @@ -3517,9 +3517,9 @@ "integrity": "sha1-qG5e5r2qFgVEddp5fM3fDFVphJE=" }, "eventemitter3": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.1.tgz", - "integrity": "sha512-MXmFv3KYbv7MPjPeGlFCTieXB9zNvmHfy4fXzZbrdMeUUk3pxQ8SS0cJ6CcwUDZnIL3ZDa01qQFzhlusB8s51Q==" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", + "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==" }, "exec-sh": { "version": "0.2.2", @@ -3796,9 +3796,9 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.8.tgz", + "integrity": "sha512-tPvHgPGB7m40CZ68xqFGkKuzN+RnpGmSV+hgeKxhRpbxdqKXUFJGC3yonBOLzQBcJyGpdZFDfCsdOC2KFsXzeA==", "optional": true, "requires": { "nan": "^2.12.1", @@ -4823,8 +4823,8 @@ } }, "lbry-redux": { - "version": "github:lbryio/lbry-redux#4b3769fc2dcc4c93771aa4c5dbb64d0e97f6375f", - "from": "github:lbryio/lbry-redux", + "version": "github:lbryio/lbry-redux#17389f806d1b3d266e8cfcd9c8973c81eec2be4b", + "from": "github:lbryio/lbry-redux#claim-search-fix", "requires": { "proxy-polyfill": "0.1.6", "reselect": "^3.0.0", @@ -4832,8 +4832,8 @@ } }, "lbryinc": { - "version": "github:lbryio/lbryinc#a8fd592c46abb65410785fd0242e91904c158fd7", - "from": "github:lbryio/lbryinc", + "version": "github:lbryio/lbryinc#bec7ce1fba7fb0d90f604170ee00c75b3d8ab7ed", + "from": "github:lbryio/lbryinc#sdk-0.36-changes", "requires": { "reselect": "^3.0.0" } @@ -6062,9 +6062,9 @@ } }, "query-string": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.5.0.tgz", - "integrity": "sha512-TYC4hDjZSvVxLMEucDMySkuAS9UIzSbAiYGyA9GWCjLKB8fQpviFbjd20fD7uejCDxZS+ftSdBKE6DS+xucJFg==", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.4.2.tgz", + "integrity": "sha512-DfJqAen17LfLA3rQ+H5S4uXphrF+ANU1lT2ijds4V/Tj4gZxA3gx5/tg1bz7kYCmwna7LyJNCYqO7jNRzo3aLw==", "requires": { "decode-uri-component": "^0.2.0", "split-on-first": "^1.0.0", @@ -6294,9 +6294,9 @@ "integrity": "sha512-pqp9loZbWHW2pVcaAItV5rtEpj6RyPnk0mRlsxRZpbJvrJArJwRMd+WT8BzC+OyTDV1TOdFJCOxDyVNL9I2XTw==" }, "react-native-gesture-handler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-1.2.0.tgz", - "integrity": "sha512-PBsqfyUlzAQQXVEy5nDB8HpehSalhN8Vlc00VJ4RT0FDxlkbpl1otT6DxUN/shMEEuOkyS9gz80ZzWTfAmeBOQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-1.1.0.tgz", + "integrity": "sha512-E9IKHpmL+sz/iCYkUriTUjBaQBORWV+oheYPQleADkxjo2sYsQfnlyTz4EQYFONkUwJ6WmfTNkYt2/yc5U4Ziw==", "requires": { "hoist-non-react-statics": "^2.3.1", "invariant": "^2.2.2", @@ -6580,12 +6580,11 @@ } }, "react-native-video": { - "version": "github:lbryio/react-native-video#0b2ed972f12f8d85d8febaff0b191444fe29cb3f", + "version": "github:lbryio/react-native-video#080395677f6ff2acd6273f4b614dd1a1f3714667", "from": "github:lbryio/react-native-video#exoplayer-lbry-android", "requires": { - "keymirror": "^0.1.1", - "prop-types": "^15.5.10", - "shaka-player": "^2.4.4" + "keymirror": "0.1.1", + "prop-types": "^15.5.10" } }, "react-navigation": { @@ -7389,11 +7388,6 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" }, - "shaka-player": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/shaka-player/-/shaka-player-2.4.7.tgz", - "integrity": "sha512-KXYVB7snrrmcmDvusf2IIGOXZCvrlb6vXkl1q0pXP/QdUkvHm2SsW6jIXKvDz9xsvs9Pt/R7tm8POgfUOzybcQ==" - }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", diff --git a/app/src/component/fileDownloadButton/view.js b/app/src/component/fileDownloadButton/view.js index 985a3a26..c3260167 100644 --- a/app/src/component/fileDownloadButton/view.js +++ b/app/src/component/fileDownloadButton/view.js @@ -73,8 +73,8 @@ class FileDownloadButton extends React.PureComponent { text={(isPlayable ? 'Play' : (isViewable ? 'View' : 'Download'))} onLayout={onButtonLayout} style={[style, fileDownloadButtonStyle.container]} onPress={() => { - if (NativeModules.Mixpanel) { - NativeModules.Mixpanel.track('Purchase Uri', { Uri: uri }); + if (NativeModules.Firebase) { + NativeModules.Firebase.track('purchase_uri', { uri: uri }); } purchaseUri(uri, onStartDownloadFailed); if (isPlayable && onPlay) { diff --git a/app/src/component/fileItem/view.js b/app/src/component/fileItem/view.js index 3ca2f773..c4b60f9b 100644 --- a/app/src/component/fileItem/view.js +++ b/app/src/component/fileItem/view.js @@ -36,8 +36,8 @@ class FileItem extends React.PureComponent { navigateToFileUri = () => { const { navigation, uri } = this.props; const normalizedUri = normalizeURI(uri); - if (NativeModules.Mixpanel) { - NativeModules.Mixpanel.track('Discover Tap', { Uri: normalizeURI }); + if (NativeModules.Firebase) { + NativeModules.Firebase.track('explore_click', { uri: normalizedUri }); } navigateToUri(navigation, normalizedUri); } diff --git a/app/src/component/searchInput/index.js b/app/src/component/searchInput/index.js index a7cefcb8..5469f359 100644 --- a/app/src/component/searchInput/index.js +++ b/app/src/component/searchInput/index.js @@ -5,8 +5,8 @@ import SearchInput from './view'; const perform = dispatch => ({ search: search => { - if (NativeModules.Mixpanel) { - NativeModules.Mixpanel.track('Search', { Query: search }); + if (NativeModules.Firebase) { + NativeModules.Firebase.track('search', { query: search }); } return dispatch(doSearch(search)); }, diff --git a/app/src/index.js b/app/src/index.js index f8dff4e2..6c5892a5 100644 --- a/app/src/index.js +++ b/app/src/index.js @@ -43,8 +43,8 @@ import thunk from 'redux-thunk'; const globalExceptionHandler = (error, isFatal) => { - if (error && NativeModules.Mixpanel) { - NativeModules.Mixpanel.logException(isFatal, error.message ? error.message : "No message", error); + if (error && NativeModules.Firebase) { + NativeModules.Firebase.logException(isFatal, error.message ? error.message : "No message", error); } }; setJSExceptionHandler(globalExceptionHandler, true); diff --git a/app/src/page/discover/view.js b/app/src/page/discover/view.js index 32e8674b..4bf95f03 100644 --- a/app/src/page/discover/view.js +++ b/app/src/page/discover/view.js @@ -34,9 +34,9 @@ class DiscoverPage extends React.PureComponent { AsyncStorage.getItem('firstLaunchSuspended').then(suspended => { AsyncStorage.removeItem('firstLaunchSuspended'); const appSuspended = (suspended === 'true'); - if (NativeModules.Mixpanel) { - NativeModules.Mixpanel.track('First Run Time', { - 'Total Seconds': delta, 'App Suspended': appSuspended + if (NativeModules.Firebase) { + NativeModules.Firebase.track('first_run_time', { + 'total_seconds': delta, 'app_suspended': appSuspended }); } }); diff --git a/app/src/page/file/view.js b/app/src/page/file/view.js index 42da2f5a..6f0f8518 100644 --- a/app/src/page/file/view.js +++ b/app/src/page/file/view.js @@ -88,8 +88,8 @@ class FilePage extends React.PureComponent { this.fetchFileInfo(this.props); this.fetchCostInfo(this.props); - if (NativeModules.Mixpanel) { - NativeModules.Mixpanel.track('Open File Page', { Uri: uri }); + if (NativeModules.Firebase) { + NativeModules.Firebase.track('open_file_page', { uri: uri }); } if (NativeModules.UtilityModule) { NativeModules.UtilityModule.keepAwakeOn(); @@ -301,12 +301,12 @@ class FilePage extends React.PureComponent { const { uri } = navigation.state.params; this.logFileView(uri, fileInfo, timeToStartMillis); - let payload = { 'Uri': uri }; + let payload = { 'uri': uri }; if (!isNaN(timeToStart)) { - payload['Time to Start (seconds)'] = timeToStart; - payload['Time to Start (ms)'] = timeToStartMillis; + payload['time_to_start_seconds'] = timeToStart; + payload['time_to_start_ms'] = timeToStartMillis; } - NativeModules.Mixpanel.track('Play', payload); + NativeModules.Firebase.track('play', payload); } onPlaybackFinished = () => { diff --git a/app/src/page/splash/view.js b/app/src/page/splash/view.js index 3365adcf..1df1e394 100644 --- a/app/src/page/splash/view.js +++ b/app/src/page/splash/view.js @@ -254,8 +254,8 @@ class SplashScreen extends React.PureComponent { } componentDidMount() { - if (NativeModules.Mixpanel) { - NativeModules.Mixpanel.track('App Launch', null); + if (NativeModules.Firebase) { + NativeModules.Firebase.track('app_launch', null); } Linking.getInitialURL().then((url) => { diff --git a/buildozer.spec.sample b/buildozer.spec.sample index cb4aec9d..2a10e128 100644 --- a/buildozer.spec.sample +++ b/buildozer.spec.sample @@ -148,7 +148,7 @@ android.react_src = ./app # (list) Gradle dependencies to add (currently works only with sdl2_gradle # bootstrap) -android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.59.3, com.mixpanel.android:mixpanel-android:5+, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828 +android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.59.3, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828, com.google.firebase:firebase-core:16.0.1 # (str) python-for-android branch to use, defaults to master #p4a.branch = stable diff --git a/buildozer.spec.travis b/buildozer.spec.travis index cb4aec9d..2a10e128 100644 --- a/buildozer.spec.travis +++ b/buildozer.spec.travis @@ -148,7 +148,7 @@ android.react_src = ./app # (list) Gradle dependencies to add (currently works only with sdl2_gradle # bootstrap) -android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.59.3, com.mixpanel.android:mixpanel-android:5+, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828 +android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.59.3, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828, com.google.firebase:firebase-core:16.0.1 # (str) python-for-android branch to use, defaults to master #p4a.branch = stable diff --git a/buildozer.spec.vagrant b/buildozer.spec.vagrant index cb4aec9d..2a10e128 100644 --- a/buildozer.spec.vagrant +++ b/buildozer.spec.vagrant @@ -148,7 +148,7 @@ android.react_src = ./app # (list) Gradle dependencies to add (currently works only with sdl2_gradle # bootstrap) -android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.59.3, com.mixpanel.android:mixpanel-android:5+, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828 +android.gradle_dependencies = com.android.support:support-v4:27.1.1, com.android.support:support-media-compat:27.1.1, com.android.support:appcompat-v7:27.1.1, com.facebook.react:react-native:0.59.3, com.google.android.gms:play-services-gcm:11.0.4+, com.facebook.fresco:fresco:1.9.0, com.facebook.fresco:animated-gif:1.9.0, com.squareup.picasso:picasso:2.71828, com.google.firebase:firebase-core:16.0.1 # (str) python-for-android branch to use, defaults to master #p4a.branch = stable diff --git a/lbry-android.keystore.secret b/lbry-android.keystore.secret index 3768f7c9..ae36c4be 100644 Binary files a/lbry-android.keystore.secret and b/lbry-android.keystore.secret differ diff --git a/p4a/pythonforandroid/bootstraps/lbry/build/build.py b/p4a/pythonforandroid/bootstraps/lbry/build/build.py index 6c64175d..71e5e7c9 100755 --- a/p4a/pythonforandroid/bootstraps/lbry/build/build.py +++ b/p4a/pythonforandroid/bootstraps/lbry/build/build.py @@ -405,10 +405,10 @@ main.py that loads it.''') android_api=android_api, build_tools_version=build_tools_version) - render( - 'settings.tmpl.gradle', - 'settings.gradle' - ) + render('settings.gradle', 'settings.gradle') + + ## google-services.json for firebase + render('google-services.json', 'google-services.json') # copy icon drawables for folder in ('drawable-hdpi', 'drawable-mdpi', 'drawable-xhdpi', 'drawable-xxhdpi', 'drawable-xxxhdpi'): diff --git a/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle b/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle index fcde802a..744f259c 100644 --- a/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle +++ b/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle @@ -6,6 +6,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.0.0' + classpath 'com.google.gms:google-services:4.0.1' } } @@ -112,3 +113,6 @@ dependencies { {%- endfor %} {%- endif %} } + +apply plugin: 'com.google.gms.google-services' +com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true diff --git a/p4a/pythonforandroid/bootstraps/lbry/build/templates/google-services.json.secret b/p4a/pythonforandroid/bootstraps/lbry/build/templates/google-services.json.secret new file mode 100644 index 00000000..faf326fb Binary files /dev/null and b/p4a/pythonforandroid/bootstraps/lbry/build/templates/google-services.json.secret differ diff --git a/p4a/pythonforandroid/bootstraps/lbry/build/templates/settings.tmpl.gradle b/p4a/pythonforandroid/bootstraps/lbry/build/templates/settings.gradle similarity index 100% rename from p4a/pythonforandroid/bootstraps/lbry/build/templates/settings.tmpl.gradle rename to p4a/pythonforandroid/bootstraps/lbry/build/templates/settings.gradle diff --git a/src/main/java/io/lbry/browser/reactmodules/FirebaseModule.java b/src/main/java/io/lbry/browser/reactmodules/FirebaseModule.java new file mode 100644 index 00000000..7804091d --- /dev/null +++ b/src/main/java/io/lbry/browser/reactmodules/FirebaseModule.java @@ -0,0 +1,80 @@ +package io.lbry.browser.reactmodules; + +import android.content.Context; +import android.os.Bundle; +import android.widget.Toast; + +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.bridge.ReactContextBaseJavaModule; +import com.facebook.react.bridge.ReactMethod; +import com.facebook.react.bridge.ReadableMap; +import com.google.firebase.analytics.FirebaseAnalytics; + +import io.lbry.browser.BuildConfig; + +import java.util.HashMap; +import java.util.Map; +import org.json.JSONObject; +import org.json.JSONException; + +public class FirebaseModule extends ReactContextBaseJavaModule { + + private Context context; + + private FirebaseAnalytics firebaseAnalytics; + + public FirebaseModule(ReactApplicationContext reactContext) { + super(reactContext); + this.context = reactContext; + this.firebaseAnalytics = FirebaseAnalytics.getInstance(context); + } + + @Override + public String getName() { + return "Firebase"; + } + + @ReactMethod + public void track(String name, ReadableMap payload) { + Bundle bundle = new Bundle(); + if (payload != null) { + HashMap payloadMap = payload.toHashMap(); + for (Map.Entry entry : payloadMap.entrySet()) { + Object value = entry.getValue(); + if (value != null) { + bundle.putString(entry.getKey(), entry.getValue().toString()); + } + } + } + + if (firebaseAnalytics != null) { + firebaseAnalytics.logEvent(name, bundle); + } + } + + @ReactMethod + public void logException(boolean fatal, String message, ReadableMap payload) { + Bundle bundle = new Bundle(); + if (payload != null) { + HashMap payloadMap = payload.toHashMap(); + for (Map.Entry entry : payloadMap.entrySet()) { + Object value = entry.getValue(); + if (value != null) { + bundle.putString(entry.getKey(), entry.getValue().toString()); + } + } + } + + if (firebaseAnalytics != null) { + firebaseAnalytics.logEvent(fatal ? "exception" : "warning", bundle); + } + + if (fatal) { + Toast.makeText(context, + "An application error occurred which has been automatically logged. " + + "If you keep seeing this message, please provide feedback to the LBRY " + + "team by emailing hello@lbry.io.", + Toast.LENGTH_LONG).show(); + } + } +} \ No newline at end of file diff --git a/src/main/java/io/lbry/browser/reactmodules/MixpanelModule.java b/src/main/java/io/lbry/browser/reactmodules/MixpanelModule.java deleted file mode 100644 index 57874d14..00000000 --- a/src/main/java/io/lbry/browser/reactmodules/MixpanelModule.java +++ /dev/null @@ -1,87 +0,0 @@ -package io.lbry.browser.reactmodules; - -import android.content.Context; -import android.widget.Toast; - -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.bridge.ReactContextBaseJavaModule; -import com.facebook.react.bridge.ReactMethod; -import com.facebook.react.bridge.ReadableMap; - -import com.mixpanel.android.mpmetrics.MixpanelAPI; - -import io.lbry.browser.BuildConfig; - -import java.util.HashMap; -import java.util.Map; -import org.json.JSONObject; -import org.json.JSONException; - -public class MixpanelModule extends ReactContextBaseJavaModule { - - private static final String MIXPANEL_TOKEN = BuildConfig.DEBUG ? - "bc1630b8be64c5dfaa4700b3a62969f3" /* Dev Testing */ : - "93b81fb957cb0ddcd3198c10853a6a95"; /* Production */ - - private Context context; - - private MixpanelAPI mixpanel; - - public MixpanelModule(ReactApplicationContext reactContext) { - super(reactContext); - this.context = reactContext; - this.mixpanel = MixpanelAPI.getInstance(this.context, MIXPANEL_TOKEN); - } - - @Override - public String getName() { - return "Mixpanel"; - } - - @ReactMethod - public void track(String name, ReadableMap payload) { - JSONObject props = new JSONObject(); - try { - if (payload != null) { - HashMap payloadMap = payload.toHashMap(); - for (Map.Entry entry : payloadMap.entrySet()) { - props.put(entry.getKey(), entry.getValue()); - } - } - } catch (JSONException e) { - // Cannot use props. Stick with empty props. - } - - if (mixpanel != null) { - mixpanel.track(name, props); - } - } - - @ReactMethod - public void logException(boolean fatal, String message, ReadableMap payload) { - JSONObject props = new JSONObject(); - try { - props.put("Message", message); - if (payload != null) { - HashMap payloadMap = payload.toHashMap(); - for (Map.Entry entry : payloadMap.entrySet()) { - props.put(entry.getKey(), entry.getValue()); - } - } - } catch (JSONException e) { - // Cannot use props. Stick with empty props. - } - - if (mixpanel != null) { - mixpanel.track(fatal ? "Exception" : "Warning", props); - } - - if (fatal) { - Toast.makeText(context, - "An application error occurred which has been automatically logged. " + - "If you keep seeing this message, please provide feedback to the LBRY " + - "team by emailing hello@lbry.io.", - Toast.LENGTH_LONG).show(); - } - } -} diff --git a/src/main/java/io/lbry/browser/reactpackages/LbryReactPackage.java b/src/main/java/io/lbry/browser/reactpackages/LbryReactPackage.java index 6ec81d00..fb6862c6 100644 --- a/src/main/java/io/lbry/browser/reactpackages/LbryReactPackage.java +++ b/src/main/java/io/lbry/browser/reactpackages/LbryReactPackage.java @@ -9,7 +9,7 @@ import io.lbry.browser.reactmodules.BackgroundMediaModule; import io.lbry.browser.reactmodules.DaemonServiceControlModule; import io.lbry.browser.reactmodules.DownloadManagerModule; import io.lbry.browser.reactmodules.FirstRunModule; -import io.lbry.browser.reactmodules.MixpanelModule; +import io.lbry.browser.reactmodules.FirebaseModule; import io.lbry.browser.reactmodules.ScreenOrientationModule; import io.lbry.browser.reactmodules.VersionInfoModule; import io.lbry.browser.reactmodules.UtilityModule;; @@ -32,7 +32,7 @@ public class LbryReactPackage implements ReactPackage { modules.add(new DaemonServiceControlModule(reactContext)); modules.add(new DownloadManagerModule(reactContext)); modules.add(new FirstRunModule(reactContext)); - modules.add(new MixpanelModule(reactContext)); + modules.add(new FirebaseModule(reactContext)); modules.add(new ScreenOrientationModule(reactContext)); modules.add(new UtilityModule(reactContext)); modules.add(new VersionInfoModule(reactContext));