Search in sources :

Example 1 with FirebaseAnalytics

use of com.google.firebase.analytics.FirebaseAnalytics in project mobile-center-sdk-android by Microsoft.

the class FirebaseUtils method setAnalyticsEnabled.

@SuppressWarnings("MissingPermission")
static void setAnalyticsEnabled(@NonNull Context context, boolean enabled) throws FirebaseUnavailableException {
    try {
        FirebaseAnalytics instance = FirebaseAnalytics.getInstance(context);
        if (instance == null) {
            throw new FirebaseUnavailableException("null instance");
        }
        instance.setAnalyticsCollectionEnabled(enabled);
    } catch (NoClassDefFoundError | IllegalAccessError e) {
        throw new FirebaseUnavailableException(e);
    }
}
Also used : FirebaseAnalytics(com.google.firebase.analytics.FirebaseAnalytics)

Example 2 with FirebaseAnalytics

use of com.google.firebase.analytics.FirebaseAnalytics in project coins-android by bubelov.

the class UserRepository method onAuthorized.

private void onAuthorized() {
    FirebaseAnalytics analytics = Injector.INSTANCE.mainComponent().analytics();
    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.SIGN_UP_METHOD, getUserAuthMethod());
    analytics.logEvent(FirebaseAnalytics.Event.SIGN_UP, bundle);
}
Also used : Bundle(android.os.Bundle) FirebaseAnalytics(com.google.firebase.analytics.FirebaseAnalytics)

Example 3 with FirebaseAnalytics

use of com.google.firebase.analytics.FirebaseAnalytics in project AppCenter-SDK-Android by Microsoft.

the class FirebaseUtils method setAnalyticsEnabled.

@SuppressWarnings("MissingPermission")
static void setAnalyticsEnabled(@NonNull Context context, boolean enabled) throws FirebaseUnavailableException {
    try {
        FirebaseAnalytics instance = FirebaseAnalytics.getInstance(context);
        if (instance == null) {
            throw new FirebaseUnavailableException("null instance");
        }
        instance.setAnalyticsCollectionEnabled(enabled);
    } catch (NoClassDefFoundError | IllegalAccessError e) {
        throw new FirebaseUnavailableException(e);
    }
}
Also used : FirebaseAnalytics(com.google.firebase.analytics.FirebaseAnalytics)

Example 4 with FirebaseAnalytics

use of com.google.firebase.analytics.FirebaseAnalytics in project kcanotify by antest1.

the class KcaUtils method sendUserAnalytics.

public static void sendUserAnalytics(Context context, String event, JsonObject value) {
    Bundle params = new Bundle();
    FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(context);
    if (value != null) {
        for (String key : value.keySet()) {
            params.putString(key, value.get(key).getAsString());
        }
    }
    mFirebaseAnalytics.logEvent(event, params);
}
Also used : Bundle(android.os.Bundle) FirebaseAnalytics(com.google.firebase.analytics.FirebaseAnalytics)

Example 5 with FirebaseAnalytics

use of com.google.firebase.analytics.FirebaseAnalytics in project anitrend-app by AniTrend.

the class TagGenreService method initAnalytics.

public final void initAnalytics() {
    FirebaseAnalytics analytics = FirebaseAnalytics.getInstance(getApplicationContext());
    analytics.setAnalyticsCollectionEnabled(true);
    analytics.setMinimumSessionDuration(KeyUtil.DURATION_LONG);
}
Also used : FirebaseAnalytics(com.google.firebase.analytics.FirebaseAnalytics)

Aggregations

FirebaseAnalytics (com.google.firebase.analytics.FirebaseAnalytics)5 Bundle (android.os.Bundle)2