コード例 #1
0
  /* package */ void clearPreferences() {
    // Will clear distinct_ids, superProperties,
    // and waiting People Analytics properties. Will have no effect
    // on messages already queued to send with AnalyticsMessages.

    SharedPreferences.Editor prefsEdit = mStoredPreferences.edit();
    prefsEdit.clear().commit();
    readSuperProperties();
    readIdentities();
  }
コード例 #2
0
  /**
   * You shouldn't instantiate MixpanelAPI objects directly. Use MixpanelAPI.getInstance to get an
   * instance.
   */
  MixpanelAPI(Context context, String token) {
    mContext = context;
    mToken = token;
    mPeople = new PeopleImpl();

    mMessages = getAnalyticsMessages();
    mSystemInformation = getSystemInformation();

    mStoredPreferences =
        context.getSharedPreferences(
            "com.mixpanel.android.mpmetrics.MixpanelAPI_" + token, Context.MODE_PRIVATE);
    readSuperProperties();
    readIdentities();
  }