Enable in app updates without analytics

This commit is contained in:
NekoInverter committed 2021-01-24 20:34:09 +08:00
1 parent a453d42df4
commit ef1cec3612
4 files changed
+8 -6

No files matched your search

@@ -31,6 +31,7 @@ public final class Analytics {
public static void start(Application application) {
AppCenter.start(application, "1aa06805-037c-4f3c-8aaa-e23d1433986d", com.microsoft.appcenter.analytics.Analytics.class, Crashes.class, Distribute.class);
AppCenter.setUserId(Settings.getUserID());
com.microsoft.appcenter.analytics.Analytics.setEnabled(Settings.getEnableAnalytics());
Crashes.setEnabled(!BuildConfig.DEBUG);
Distribute.setEnabledForDebuggableBuild(false);
}
@@ -39,6 +40,10 @@ public final class Analytics {
return AppCenter.isConfigured() && Settings.getEnableAnalytics();
}
public static void setEnabled(boolean enabled) {
com.microsoft.appcenter.analytics.Analytics.setEnabled(enabled);
}
public static void onSceneView(SceneFragment scene) {
if (isEnabled()) {
Map<String, String> properties = new HashMap<>();