예제 #1
0
        private static string ConvertParameters(Dictionary <string, string> parameters)
        {
            if (parameters == null)
            {
                return(null);
            }
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("{\n");
            bool flag = true;

            foreach (KeyValuePair <string, string> keyValuePair in parameters)
            {
                if (!flag)
                {
                    stringBuilder.Append(',');
                }
                FlurryAnalyticsIOS.SerializeString(stringBuilder, keyValuePair.Key);
                stringBuilder.Append(":");
                FlurryAnalyticsIOS.SerializeString(stringBuilder, keyValuePair.Value);
                flag = false;
            }
            stringBuilder.Append("}\n");
            return(stringBuilder.ToString());
        }
예제 #2
0
        /// <summary>
        /// Sets the time the app may be in the background before starting a new session upon resume.
        /// Default value 10 seconds.
        ///
        /// Should be called before StartSession.
        /// </summary>
        public void SetSessionContinueSeconds(int seconds)
        {
#if UNITY_IOS
            FlurryAnalyticsIOS.SetSessionContinueSeconds(seconds);
#elif UNITY_ANDROID
            FlurryAnalyticsAndroid.SetContinueSessionMillis(seconds * 1000);
#endif
        }
예제 #3
0
 private static void DebugLog(string log)
 {
     if (!FlurryAnalyticsIOS.EditorDebugLogEnabled())
     {
         return;
     }
     UnityEngine.Debug.Log("[FlurryAnalyticsPlugin]: " + log);
 }
예제 #4
0
        /// <summary>
        /// Enable/Disable Flurry SDK debug logs.
        ///
        /// By default logs are disabled.
        /// Should be called before StartSession.
        /// </summary>
        public void SetDebugLogEnabled(bool enabled)
        {
#if UNITY_IOS
            FlurryAnalyticsIOS.SetDebugLogEnabled(enabled);
#elif UNITY_ANDROID
            FlurryAnalyticsAndroid.SetLogEnabled(enabled);
#endif
        }
예제 #5
0
        /// <summary>
        /// Explicitly set app version..
        /// Should be called before StartSession.
        /// </summary>
        /// <param name="appVersion">App version.</param>
        public void SetAppVersion(string appVersion)
        {
#if UNITY_IOS
            FlurryAnalyticsIOS.SetAppVersion(appVersion);
#elif UNITY_ANDROID
            FlurryAnalyticsAndroid.SetVersionName(appVersion);
#endif
        }
예제 #6
0
        /// <summary>
        /// Ends a timed event specified by eventName and optionally updates parameters with parameters.
        /// </summary>
        /// <param name="eventName">
        /// Name of the event. For maximum effectiveness, we recommend using a naming scheme
        /// that can be easily understood by non-technical people in your business domain.
        /// </param>
        /// <param name="parameters">An immutable copy of map containing Name-Value pairs of parameters.</param>
        public void EndTimedEvent(string eventName, Dictionary <string, string> parameters = null)
        {
#if UNITY_IOS
            FlurryAnalyticsIOS.EndTimedEvent(eventName, parameters);
#elif UNITY_ANDROID
            FlurryAnalyticsAndroid.EndTimedEvent(eventName, parameters);
#endif
        }
예제 #7
0
        /// <summary>
        /// Use this method to capture the age of your user.
        /// </summary>
        public void SetAge(int age)
        {
#if UNITY_IOS
            FlurryAnalyticsIOS.SetAge(age);
#elif UNITY_ANDROID
            FlurryAnalyticsAndroid.SetAge(age);
#endif
        }
예제 #8
0
        /// <summary>
        /// Start Flurry session.
        /// </summary>
        /// <param name="iOSApiKey">iOS API key.</param>
        /// <param name="androidApiKey">Android API key.</param>
        public void StartSession(string iOSApiKey, string androidApiKey, bool sendErrorsToFlurry)
        {
#if UNITY_IOS
            FlurryAnalyticsIOS.StartSession(iOSApiKey, sendErrorsToFlurry);
#elif UNITY_ANDROID
            FlurryAnalyticsAndroid.Init(androidApiKey, sendErrorsToFlurry);
            FlurryAnalyticsAndroid.OnStartSession();
#endif
        }
예제 #9
0
        /// <summary>
        /// Records a custom parameterized timed event specified by eventName with parameters.
        /// A maximum of 10 parameter names may be associated with any event.
        /// </summary>
        /// <param name="eventName">
        /// Name of the event. For maximum effectiveness, we recommend using a naming scheme
        /// that can be easily understood by non-technical people in your business domain.
        /// </param>
        /// <param name="parameters">An immutable copy of map containing Name-Value pairs of parameters.</param>
        /// <param name="isTimed">If set to <c>true</c> event will be timed.
        /// Call EndTimedEvent to stop timed event.</param>
        public void LogEventWithParameters(string eventName, Dictionary <string, string> parameters, bool isTimed)
        {
#if UNITY_IOS
            FlurryAnalyticsIOS.LogEventWithParameters(eventName, parameters, isTimed);
#elif UNITY_ANDROID
            FlurryAnalyticsAndroid.LogEventWithParameters(eventName, parameters, isTimed);
#endif

            ReplicateEventToUnityAnalytics(eventName, parameters);
        }
예제 #10
0
        /// <summary>
        /// Records a timed event specified by eventName.
        /// </summary>
        /// <param name="eventName">
        /// Name of the event. For maximum effectiveness, we recommend using a naming scheme
        /// that can be easily understood by non-technical people in your business domain.
        /// </param>
        /// <param name="isTimed">If set to <c>true</c> event will be timed.
        /// Call EndTimedEvent to stop timed event.</param>
        public void LogEvent(string eventName, bool isTimed)
        {
#if UNITY_IOS
            FlurryAnalyticsIOS.LogEvent(eventName, isTimed);
#elif UNITY_ANDROID
            FlurryAnalyticsAndroid.LogEvent(eventName, isTimed);
#endif

            ReplicateEventToUnityAnalytics(eventName);
        }
예제 #11
0
        /// <summary>
        /// Set user's gender.
        /// </summary>
        public void SetGender(FlurryAnalytics.Gender gender)
        {
#if UNITY_IOS
            FlurryAnalyticsIOS.SetGender(gender);
#elif UNITY_ANDROID
            FlurryAnalyticsAndroid.SetGender(gender);
#endif

            ReplicateUserGenderToUnityAnalytics(gender);
        }
예제 #12
0
        /// <summary>
        /// Assign a unique id for a user in your app.
        /// </summary>
        public void SetUserId(string userId)
        {
#if UNITY_IOS
            FlurryAnalyticsIOS.SetUserId(userId);
#elif UNITY_ANDROID
            FlurryAnalyticsAndroid.SetUserId(userId);
#endif

            ReplicateUserIdToUnityAnalytics(userId);
        }