Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[*] Updated the MixPanel library, and all the references

  • Loading branch information...
commit 9e2ed3acbc9bdcbd521d52091563456e3b6cfbef 1 parent 14c9ad1
@artiomchi authored
Showing with 10 additions and 9 deletions.
  1. +10 −9 src/org/flexlabs/widgets/dualbattery/MixPanelComponent.java
View
19 src/org/flexlabs/widgets/dualbattery/MixPanelComponent.java
@@ -34,19 +34,20 @@
private MPMetrics mpMetrics;
public MixPanelComponent(Context context) {
- if (ENABLED)
- mpMetrics = new MPMetrics(context, API_KEY);
+ if (ENABLED) {
+ mpMetrics = MPMetrics.getInstance(context, API_KEY);
+ JSONObject superProperties = new JSONObject();
+ try {
+ superProperties.put("appVersion", Constants.VERSION);
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ mpMetrics.registerSuperProperties(superProperties);
+ }
}
public void track(String eventName, JSONObject properties) {
if (!ENABLED || mpMetrics == null) return;
- if (properties == null)
- properties = new JSONObject();
- try {
- properties.put("appVersion", Constants.VERSION);
- } catch (JSONException e) {
- e.printStackTrace();
- }
mpMetrics.track(eventName, properties);
}
Please sign in to comment.
Something went wrong with that request. Please try again.