Example #1
0
 public static void EndTimedEvent(string eventName, Dictionary <string, string> parameters = null)
 {
     FlurryAnalyticsAndroid.DebugLog("End timed event: " + eventName);
     if (!FlurryAnalyticsAndroid.IsAndroidPlayer())
     {
         return;
     }
     if (parameters == null)
     {
         FlurryAnalyticsAndroid.Flurry.CallStatic("endTimedEvent", new object[]
         {
             eventName
         });
     }
     else
     {
         using (AndroidJavaObject androidJavaObject = FlurryAnalyticsAndroid.ConvertDictionaryToJavaHashMap(parameters))
         {
             FlurryAnalyticsAndroid.Flurry.CallStatic("endTimedEvent", new object[]
             {
                 eventName,
                 androidJavaObject
             });
         }
     }
 }
Example #2
0
 public static void SetPulseEnabled(bool enabled)
 {
     if (!FlurryAnalyticsAndroid.IsAndroidPlayer())
     {
         return;
     }
     FlurryAnalyticsAndroid.Flurry.CallStatic("setPulseEnabled", new object[]
     {
         enabled
     });
 }
Example #3
0
 public static void SetAge(int age)
 {
     FlurryAnalyticsAndroid.DebugLog("Set user age: " + age);
     if (!FlurryAnalyticsAndroid.IsAndroidPlayer())
     {
         return;
     }
     FlurryAnalyticsAndroid.Flurry.CallStatic("setAge", new object[]
     {
         age
     });
 }
Example #4
0
 public static void SetGender(FlurryAnalytics.Gender gender)
 {
     FlurryAnalyticsAndroid.DebugLog("Set user gender: " + gender);
     if (!FlurryAnalyticsAndroid.IsAndroidPlayer())
     {
         return;
     }
     FlurryAnalyticsAndroid.Flurry.CallStatic("setGender", new object[]
     {
         (gender != FlurryAnalytics.Gender.Male) ? 0 : 1
     });
 }
Example #5
0
 public static void SetUserId(string userId)
 {
     FlurryAnalyticsAndroid.DebugLog("Set unique user id: " + userId);
     if (!FlurryAnalyticsAndroid.IsAndroidPlayer())
     {
         return;
     }
     FlurryAnalyticsAndroid.Flurry.CallStatic("setUserId", new object[]
     {
         userId
     });
 }
Example #6
0
 public static void SetCaptureUncaughtExceptions(bool enabled)
 {
     FlurryAnalyticsAndroid.DebugLog("Set capture unchaught exceptions: " + enabled);
     if (!FlurryAnalyticsAndroid.IsAndroidPlayer())
     {
         return;
     }
     FlurryAnalyticsAndroid.Flurry.CallStatic("setCaptureUncaughtExceptions", new object[]
     {
         enabled
     });
 }
Example #7
0
 public static void SetContinueSessionMillis(long milliseconds)
 {
     FlurryAnalyticsAndroid.DebugLog("Set continue session seconds to: " + milliseconds / 1000L);
     if (!FlurryAnalyticsAndroid.IsAndroidPlayer())
     {
         return;
     }
     FlurryAnalyticsAndroid.Flurry.CallStatic("setContinueSessionMillis", new object[]
     {
         milliseconds
     });
 }
Example #8
0
 public static void SetReportLocation(bool report)
 {
     FlurryAnalyticsAndroid.DebugLog("Set report location: " + report);
     if (!FlurryAnalyticsAndroid.IsAndroidPlayer())
     {
         return;
     }
     FlurryAnalyticsAndroid.Flurry.CallStatic("setReportLocation", new object[]
     {
         report
     });
 }
Example #9
0
 public static void SetVersionName(string versionName)
 {
     FlurryAnalyticsAndroid.DebugLog("Application version changed to: " + versionName);
     if (!FlurryAnalyticsAndroid.IsAndroidPlayer())
     {
         return;
     }
     FlurryAnalyticsAndroid.Flurry.CallStatic("setVersionName", new object[]
     {
         versionName
     });
 }
Example #10
0
 public static void OnEndSession()
 {
     FlurryAnalyticsAndroid.DebugLog("Session ended");
     if (!FlurryAnalyticsAndroid.IsAndroidPlayer())
     {
         return;
     }
     using (AndroidJavaClass androidJavaClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
     {
         using (AndroidJavaObject @static = androidJavaClass.GetStatic <AndroidJavaObject>("currentActivity"))
         {
             FlurryAnalyticsAndroid.Flurry.CallStatic("onStartSession", new object[]
             {
                 @static
             });
         }
     }
 }
Example #11
0
 public static void LogEvent(string eventName, bool isTimed = false)
 {
     FlurryAnalyticsAndroid.DebugLog(string.Concat(new object[]
     {
         "Log event: ",
         eventName,
         " isTimed: ",
         isTimed
     }));
     if (!FlurryAnalyticsAndroid.IsAndroidPlayer())
     {
         return;
     }
     FlurryAnalyticsAndroid.Flurry.CallStatic <AndroidJavaObject>("logEvent", new object[]
     {
         eventName,
         isTimed
     });
 }
Example #12
0
 public static void SetLocation(float latitude, float longitude)
 {
     FlurryAnalyticsAndroid.DebugLog(string.Concat(new object[]
     {
         "Set location: ",
         latitude,
         ", ",
         longitude
     }));
     if (!FlurryAnalyticsAndroid.IsAndroidPlayer())
     {
         return;
     }
     FlurryAnalyticsAndroid.Flurry.CallStatic("setLocation", new object[]
     {
         latitude,
         longitude
     });
 }
Example #13
0
 public static void Init(string apiKey, bool captureUncaughtExceptions = false)
 {
     FlurryAnalyticsAndroid.DebugLog(string.Concat(new object[]
     {
         "Init with key: ",
         apiKey,
         " capture exceptions: ",
         captureUncaughtExceptions
     }));
     if (!FlurryAnalyticsAndroid.IsAndroidPlayer())
     {
         return;
     }
     if (apiKey != null)
     {
         apiKey = apiKey.ToUpper();
     }
     if (string.IsNullOrEmpty(apiKey))
     {
         FlurryAnalyticsAndroid.DebugLogError("Android API key is null or empty, please provide valid API key");
     }
     using (AndroidJavaClass androidJavaClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
     {
         using (AndroidJavaObject @static = androidJavaClass.GetStatic <AndroidJavaObject>("currentActivity"))
         {
             FlurryAnalyticsAndroid.Flurry.CallStatic("setCaptureUncaughtExceptions", new object[]
             {
                 captureUncaughtExceptions
             });
             FlurryAnalyticsAndroid.Flurry.CallStatic("init", new object[]
             {
                 @static,
                 apiKey.ToUpper()
             });
         }
     }
 }
Example #14
0
 public static void LogEventWithParameters(string eventName, Dictionary <string, string> parameters, bool isTimed = false)
 {
     FlurryAnalyticsAndroid.DebugLog(string.Concat(new object[]
     {
         "Log event: ",
         eventName,
         " isTimed: ",
         isTimed,
         " with parameters"
     }));
     if (!FlurryAnalyticsAndroid.IsAndroidPlayer())
     {
         return;
     }
     using (AndroidJavaObject androidJavaObject = FlurryAnalyticsAndroid.ConvertDictionaryToJavaHashMap(parameters))
     {
         FlurryAnalyticsAndroid.Flurry.CallStatic <AndroidJavaObject>("logEvent", new object[]
         {
             eventName,
             androidJavaObject,
             isTimed
         });
     }
 }