Search in sources :

Example 11 with CustomEvent

use of com.crashlytics.android.answers.CustomEvent in project edx-app-android by edx.

the class AnswersAnalytics method trackEnrolmentSuccess.

@Override
public void trackEnrolmentSuccess(@NonNull String courseId, boolean emailOptIn) {
    final CustomEvent event = new CustomEvent(Events.COURSE_ENROLL_SUCCESS);
    AnswersEventUtil.setCustomProperties(event);
    AnswersEventUtil.addCategoryToBiEvents(event, Values.CONVERSION, courseId);
    event.putCustomAttribute(Keys.NAME, Values.USER_COURSE_ENROLL_SUCCESS).putCustomAttribute(Analytics.Keys.COURSE_ID, courseId).putCustomAttribute(Keys.EMAIL_OPT_IN, emailOptIn ? 1 : 0);
    tracker.logCustom(event);
}
Also used : CustomEvent(com.crashlytics.android.answers.CustomEvent)

Example 12 with CustomEvent

use of com.crashlytics.android.answers.CustomEvent in project androidApp by InspectorIncognito.

the class FabricLogger method log.

@Override
public void log(String eventName, Map<String, String> attributes) {
    CustomEvent event = new CustomEvent(eventName);
    attributes = attributes == null ? new HashMap<String, String>() : attributes;
    for (String attributeKey : attributes.keySet()) {
        event.putCustomAttribute(attributeKey, attributes.get(attributeKey));
    }
    Answers.getInstance().logCustom(event);
}
Also used : CustomEvent(com.crashlytics.android.answers.CustomEvent) HashMap(java.util.HashMap)

Example 13 with CustomEvent

use of com.crashlytics.android.answers.CustomEvent in project Rutgers-Course-Tracker by tevjef.

the class SectionInfoPresenterImpl method toggleFab.

public void toggleFab() {
    boolean sectionTracked = mDatabaseHandler.isSectionTracked(mSection.getRequest());
    if (sectionTracked) {
        removeSection(mSection.getRequest());
    } else {
        Answers.getInstance().logCustom(new CustomEvent("Tracked Section").putCustomAttribute("Subject", mSection.getCourse().getEnclosingSubject().getDescription()).putCustomAttribute("Course", mSection.getCourse().getTrueTitle()));
        addSection(mSection.getRequest());
    }
}
Also used : CustomEvent(com.crashlytics.android.answers.CustomEvent)

Example 14 with CustomEvent

use of com.crashlytics.android.answers.CustomEvent in project Shuttle by timusus.

the class AnalyticsManager method logChangelogViewed.

public static void logChangelogViewed() {
    if (!analyticsEnabled()) {
        return;
    }
    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "changelog");
    bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "0");
    FirebaseAnalytics.getInstance(ShuttleApplication.getInstance()).logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
    Answers.getInstance().logCustom(new CustomEvent("Changelog Viewed"));
}
Also used : CustomEvent(com.crashlytics.android.answers.CustomEvent) Bundle(android.os.Bundle)

Example 15 with CustomEvent

use of com.crashlytics.android.answers.CustomEvent in project quran_android by quran.

the class QuranDataActivity method onRequestPermissionsResult.

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    if (requestCode == REQUEST_WRITE_TO_SDCARD_PERMISSIONS) {
        if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
            /**
             * taking a risk here. on nexus 6, the permission is granted automatically. on the emulator,
             * a restart is required. on reddit, someone with a nexus 9 said they also didn't need to
             * restart for the permission to take effect.
             *
             * going to assume that it just works to avoid meh code (a check to see if i can actually
             * write, and a PendingIntent plus System.exit to restart the app otherwise). logging to
             * know if we should actually have that code or not.
             *
             * also see:
             * http://stackoverflow.com/questions/32471888/
             */
            Answers.getInstance().logCustom(new CustomEvent("storagePermissionGranted"));
            if (!canWriteSdcardAfterPermissions()) {
                Answers.getInstance().logCustom(new CustomEvent("storagePermissionNeedsRestart"));
                Toast.makeText(this, R.string.storage_permission_please_restart, Toast.LENGTH_LONG).show();
            }
            checkPages();
        } else {
            Answers.getInstance().logCustom(new CustomEvent("storagePermissionDenied"));
            final File fallbackFile = getExternalFilesDir(null);
            if (fallbackFile != null) {
                quranSettings.setAppCustomLocation(fallbackFile.getAbsolutePath());
                checkPages();
            } else {
                // set to null so we can try again next launch
                quranSettings.setAppCustomLocation(null);
                runListView();
            }
        }
    }
}
Also used : CustomEvent(com.crashlytics.android.answers.CustomEvent) File(java.io.File)

Aggregations

CustomEvent (com.crashlytics.android.answers.CustomEvent)28 Intent (android.content.Intent)6 Bundle (android.os.Bundle)3 HashMap (java.util.HashMap)3 Activity (android.app.Activity)2 ActivityNotFoundException (android.content.ActivityNotFoundException)2 Context (android.content.Context)2 Uri (android.net.Uri)2 AsyncTask (android.os.AsyncTask)2 AlertDialog (android.support.v7.app.AlertDialog)2 TextUtils (android.text.TextUtils)2 Toast (android.widget.Toast)2 Answers (com.crashlytics.android.answers.Answers)2 Sensor (com.eveningoutpost.dexdrip.Models.Sensor)2 StatsResult (com.eveningoutpost.dexdrip.stats.StatsResult)2 PermissionUtil (com.quran.labs.androidquran.service.util.PermissionUtil)2 QuranFileUtils (com.quran.labs.androidquran.util.QuranFileUtils)2 QuranScreenInfo (com.quran.labs.androidquran.util.QuranScreenInfo)2 QuranSettings (com.quran.labs.androidquran.util.QuranSettings)2 File (java.io.File)2