Esempio n. 1
0
    public void logEvent()
    {
        Dictionary <string, string> eventValues = new Dictionary <string, string>();

        eventValues.Add(AFInAppEvents.CURRENCY, "USD");
        eventValues.Add(AFInAppEvents.REVENUE, "0.99");
        eventValues.Add("af_quantity", "1");
        AppsFlyer.sendEvent(AFInAppEvents.PURCHASE, eventValues);
    }
Esempio n. 2
0
        private void OnStartLevel(ResponseStartLevelDto response)
        {
            PlayerController.SetMapLevel(maxPlayerLevel);
            SceneManager.LoadSceneAsync(2);

            var eventData = new Dictionary <string, string>();

            eventData.Add(AFInAppEvents.LEVEL, response.Level.ToString());
            AppsFlyer.sendEvent(AFInAppEvents.START_LEVEL, eventData);
        }
Esempio n. 3
0
 private void onSDKStarted()
 {
     AppsFlyer.OnRequestResponse += (sender, args) =>
     {
         var af_args = args as AppsFlyerRequestEventArgs;
         if (af_args.statusCode == 200)
         {
             Dictionary <string, string> eventValues = new Dictionary <string, string>();
             eventValues.Add("af_id", "12345");
             AppsFlyer.sendEvent("first_open", eventValues);
         }
     };
 }
        /// <summary>
        /// Send an AppsFlyer event with attributes
        /// </summary>
        /// <param name="eventName">Event name</param>
        /// <param name="attributes">Attributes</param>
        protected override void TrackEventInternal(string eventName, Dictionary <string, object> attributes)
        {
            var appsflyerEventAttribs = new Dictionary <string, string>();

            foreach (var p in _globalTrackingAttributes)
            {
                appsflyerEventAttribs[p.Key] = p.Value.ToString();
            }
            foreach (var p in attributes)
            {
                appsflyerEventAttribs[p.Key] = p.Value.ToString();
            }
            AppsFlyer.sendEvent(eventName, appsflyerEventAttribs);
        }
Esempio n. 5
0
 private void OpenNextScene(Country res)
 {
     if (res.countryCode.ToLower() == "ru")
     {
         Screen.orientation = ScreenOrientation.LandscapeLeft;
         SceneManager.LoadScene(1);
         AppsFlyer.sendEvent("webview-srarted", null);
         FB.LogAppEvent("webview-srarted");
     }
     else
     {
         SceneManager.LoadScene(2);
         AppsFlyer.sendEvent("wrapper", null);
         FB.LogAppEvent("wrapper");
         Debug.Log(res.countryCode);
     }
 }
    public static void LogUser(string eventName, UserData userData)
    {
        if (instance == null)
        {
            return;
        }

#if USE_APPSFLYER
        AppsFlyer.sendEvent(eventName.ToLower(),
                            new Dictionary <string, string>
        {
            //{ "session", user.Session.ToString() },
            //{ "total_play", user.TotalPlay.ToString() },
            //{ "total_ad_rewarded", user.TotalAdRewarded.ToString() },
            //{ "total_ad_interstitial", user.TotalAdInterstitial.ToString() },
            //{ "total_days_plays", ((DateTime.Now - user.FistTimeOpen).TotalDays).ToString("#0.0") },
            //{ "current_version", user.VersionCurrent.ToString() },
            //{ "install_version", user.VersionInstall.ToString() },
            //{ "ab_testing", user.ABTesting }
        });
#endif
        Debug.Log(TAG + "LogUser " + eventName);
    }
Esempio n. 7
0
 public static void SendEvent(string eventName)
 {
     AppsFlyer.sendEvent(eventName, null);
 }
    public static void Log(eventId id)
    {
        if (instance == null && eventDic == null)
        {
            return;
        }

        try
        {
            int count = SetEvent(id);

            if (id == eventId.level_up || id == eventId.session)
            {
#if USE_APPSFLYER
                AppsFlyer.sendEvent(id.ToString(), new Dictionary <string, string> {
                    { id.ToString(), count.ToString() }
                });
#endif
                Debug.Log(TAG + "Log " + id.ToString() + " " + count);
                return;
            }

            if (id == eventId.level_up ||
                id == eventId.ad_banner_show || id == eventId.ad_banner_click ||
                id == eventId.ad_interstitial_show || id == eventId.ad_interstitial_click ||
                id == eventId.ad_videorewared_show || id == eventId.ad_videorewared_click)
            {
#if USE_APPSFLYER
                AppsFlyer.sendEvent(id.ToString(), new Dictionary <string, string> {
                    { id.ToString(), count.ToString() }
                });
#endif
                Debug.Log(TAG + "Log " + id.ToString() + " " + count);
            }

            string counter = count.ToString();
            if (count > 10)
            {
                counter = "N";
            }
            string eventName = id + "_" + counter;

            if ((id == eventId.ad_interstitial_show || id == eventId.ad_interstitial_click) && count >= 5 && count % 5 != 0)
            {
                Debug.Log(TAG + "Log " + eventName + " RETURN " + count);
                return;
            }
            else if ((id == eventId.ad_videorewared_show || id == eventId.ad_videorewared_click) && count >= 5 && count % 5 != 0)
            {
                Debug.Log(TAG + "Log " + eventName + " RETURN " + count);
                return;
            }
            else if ((id == eventId.ad_banner_show || id == eventId.ad_banner_click) && count >= 10 && count % 10 != 0)
            {
                Debug.Log(TAG + "Log " + eventName + " RETURN " + count);
                return;
            }
#if USE_APPSFLYER
            AppsFlyer.sendEvent(eventName.ToLower(), new Dictionary <string, string> {
                { id.ToString(), count.ToString() }
            });
#endif
            Debug.Log(TAG + "Log " + eventName + " " + count);
        }
        catch (Exception ex)
        {
            Debug.LogError(TAG + "Log " + ex.Message);
        }
    }
    public override void LogLevelFailed(MemorySystemData data)
    {
        base.LogLevelFailed(data);

        AppsFlyer.sendEvent("Level_Fail", GetAppsFlyerEventDictionary(data));
    }
Esempio n. 10
0
    public void TrackingEvent(string eventName, Dictionary <string, string> eventValues)
    {
#if TRACKING_APPSFLYER
        AppsFlyer.sendEvent(eventName, eventValues);
#endif
    }
 /// <summary>
 /// Send an AppsFlyer event with no attributes
 /// </summary>
 /// <param name="eventName">Event name</param>
 protected override void TrackEventInternal(string eventName)
 {
     AppsFlyer.sendEvent(eventName, new Dictionary <string, string>());
 }
Esempio n. 12
0
 private void Start()
 {
     FB.LogAppEvent("i-am-working");
     AppsFlyer.sendEvent("i-am-working", null);
 }