示例#1
0
        private void btnCallbakEvent_Click(object sender, RoutedEventArgs e)
        {
            var callbackEvent = new AdjustEvent("{yourCallbackEventToken}");

            callbackEvent.AddPartnerParameter("key", "value");
            Adjust.TrackEvent(callbackEvent);
        }
示例#2
0
        private void btnPartnerEvent_Click(object sender, RoutedEventArgs e)
        {
            var partnerEvent = new AdjustEvent("{yourPartnerEventToken}");

            partnerEvent.AddPartnerParameter("foo", "bar");
            Adjust.TrackEvent(partnerEvent);
        }
示例#3
0
        public static void TrackEvent(string eventToken, double?revenue, string currency, List <string> callbackList, List <string> partnerList)
        {
            var adjustEvent = new AdjustEvent(eventToken);

            if (revenue.HasValue)
            {
                adjustEvent.SetRevenue(revenue.Value, currency);
            }

            if (callbackList != null)
            {
                for (int i = 0; i < callbackList.Count; i += 2)
                {
                    var key   = callbackList[i];
                    var value = callbackList[i + 1];

                    adjustEvent.AddCallbackParameter(key, value);
                }
            }

            if (partnerList != null)
            {
                for (int i = 0; i < partnerList.Count; i += 2)
                {
                    var key   = partnerList[i];
                    var value = partnerList[i + 1];

                    adjustEvent.AddPartnerParameter(key, value);
                }
            }

            Adjust.TrackEvent(adjustEvent);
        }
示例#4
0
        public static void TrackEvent(string eventToken, double?revenue, string currency,
                                      string purchaseId, string callbackId, List <string> callbackList, List <string> partnerList)
        {
#if NETFX_CORE
            var adjustEvent = new AdjustEvent(eventToken)
            {
                PurchaseId = purchaseId
            };

            if (revenue.HasValue)
            {
                adjustEvent.SetRevenue(revenue.Value, currency);
            }

            if (!string.IsNullOrEmpty(callbackId))
            {
                adjustEvent.CallbackId = callbackId;
            }

            if (callbackList != null)
            {
                for (int i = 0; i < callbackList.Count; i += 2)
                {
                    var key   = callbackList[i];
                    var value = callbackList[i + 1];

                    adjustEvent.AddCallbackParameter(key, value);
                }
            }

            if (partnerList != null)
            {
                for (int i = 0; i < partnerList.Count; i += 2)
                {
                    var key   = partnerList[i];
                    var value = partnerList[i + 1];

                    adjustEvent.AddPartnerParameter(key, value);
                }
            }

            Adjust.TrackEvent(adjustEvent);
#endif
        }
示例#5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource.
            SetContentView(Resource.Layout.Main);

            Intent intent = this.Intent;
            var    data   = intent.Data;

            Adjust.AppWillOpenUrl(data);

            // Get our button from the layout resource,
            // and attach an event to it.
            Button btnTrackSimpleEvent   = FindViewById <Button>(Resource.Id.btnTrackSimpleEvent);
            Button btnTrackRevenueEvent  = FindViewById <Button>(Resource.Id.btnTrackRevenueEvent);
            Button btnTrackCallbackEvent = FindViewById <Button>(Resource.Id.btnTrackCallbackEvent);
            Button btnTrackPartnerEvent  = FindViewById <Button>(Resource.Id.btnTrackPartnerEvent);
            Button btnEnableOfflineMode  = FindViewById <Button>(Resource.Id.btnEnableOfflineMode);
            Button btnDisableOfflineMode = FindViewById <Button>(Resource.Id.btnDisableOfflineMode);
            Button btnEnableSDK          = FindViewById <Button>(Resource.Id.btnEnableSDK);
            Button btnDisableSDK         = FindViewById <Button>(Resource.Id.btnDisableSDK);
            Button btnIsSDKEnabled       = FindViewById <Button>(Resource.Id.btnIsSDKEnabled);

            btnTrackSimpleEvent.Click += delegate
            {
                AdjustEvent adjustEvent = new AdjustEvent("g3mfiw");
                Adjust.TrackEvent(adjustEvent);
            };

            btnTrackRevenueEvent.Click += delegate
            {
                AdjustEvent adjustEvent = new AdjustEvent("a4fd35");

                // Add revenue 1 cent of an euro.
                adjustEvent.SetRevenue(0.01, "EUR");
                adjustEvent.SetOrderId("dummy_id");

                Adjust.TrackEvent(adjustEvent);
            };

            btnTrackCallbackEvent.Click += delegate
            {
                AdjustEvent adjustEvent = new AdjustEvent("34vgg9");

                // Add callback parameters to this parameter.
                adjustEvent.AddCallbackParameter("a", "b");
                adjustEvent.AddCallbackParameter("key", "value");
                adjustEvent.AddCallbackParameter("a", "c");

                Adjust.TrackEvent(adjustEvent);
            };

            btnTrackPartnerEvent.Click += delegate
            {
                AdjustEvent adjustEvent = new AdjustEvent("w788qs");

                // Add partner parameters to this parameter.
                adjustEvent.AddPartnerParameter("x", "y");
                adjustEvent.AddPartnerParameter("foo", "bar");
                adjustEvent.AddPartnerParameter("x", "z");

                Adjust.TrackEvent(adjustEvent);
            };

            btnEnableOfflineMode.Click += delegate
            {
                Adjust.SetOfflineMode(true);
            };

            btnDisableOfflineMode.Click += delegate
            {
                Adjust.SetOfflineMode(false);
            };

            btnEnableSDK.Click += delegate
            {
                Adjust.Enabled = true;
            };

            btnDisableSDK.Click += delegate
            {
                Adjust.Enabled = false;
            };

            btnIsSDKEnabled.Click += delegate
            {
                string message = Adjust.Enabled ? "SDK is ENABLED" : "SDK is DISABLED";
                Toast.MakeText(this, message, ToastLength.Short).Show();
            };
        }
示例#6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource.
            SetContentView(Resource.Layout.Main);

            Intent intent = this.Intent;
            var    data   = intent.Data;

            Adjust.AppWillOpenUrl(data, this);

            // Get our button from the layout resource,
            // and attach an event to it.
            Button btnTrackSimpleEvent   = FindViewById <Button>(Resource.Id.btnTrackSimpleEvent);
            Button btnTrackRevenueEvent  = FindViewById <Button>(Resource.Id.btnTrackRevenueEvent);
            Button btnTrackCallbackEvent = FindViewById <Button>(Resource.Id.btnTrackCallbackEvent);
            Button btnTrackPartnerEvent  = FindViewById <Button>(Resource.Id.btnTrackPartnerEvent);
            Button btnEnableOfflineMode  = FindViewById <Button>(Resource.Id.btnEnableOfflineMode);
            Button btnDisableOfflineMode = FindViewById <Button>(Resource.Id.btnDisableOfflineMode);
            Button btnEnableSDK          = FindViewById <Button>(Resource.Id.btnEnableSDK);
            Button btnDisableSDK         = FindViewById <Button>(Resource.Id.btnDisableSDK);
            Button btnIsSDKEnabled       = FindViewById <Button>(Resource.Id.btnIsSDKEnabled);
            Button btnGetIds             = FindViewById <Button>(Resource.Id.btnGetIds);

            btnTrackSimpleEvent.Click += delegate
            {
                AdjustEvent adjustEvent = new AdjustEvent("g3mfiw");
                Adjust.TrackEvent(adjustEvent);
            };

            btnTrackRevenueEvent.Click += delegate
            {
                AdjustEvent adjustEvent = new AdjustEvent("a4fd35");

                // Add revenue 1 cent of an euro.
                adjustEvent.SetRevenue(0.01, "EUR");
                adjustEvent.SetOrderId("dummy_id");

                Adjust.TrackEvent(adjustEvent);
            };

            btnTrackCallbackEvent.Click += delegate
            {
                AdjustEvent adjustEvent = new AdjustEvent("34vgg9");

                // Add callback parameters to this parameter.
                adjustEvent.AddCallbackParameter("a", "b");
                adjustEvent.AddCallbackParameter("key", "value");
                adjustEvent.AddCallbackParameter("a", "c");

                Adjust.TrackEvent(adjustEvent);
            };

            btnTrackPartnerEvent.Click += delegate
            {
                AdjustEvent adjustEvent = new AdjustEvent("w788qs");

                // Add partner parameters to this parameter.
                adjustEvent.AddPartnerParameter("x", "y");
                adjustEvent.AddPartnerParameter("foo", "bar");
                adjustEvent.AddPartnerParameter("x", "z");

                Adjust.TrackEvent(adjustEvent);
            };

            btnEnableOfflineMode.Click += delegate
            {
                Adjust.SetOfflineMode(true);
            };

            btnDisableOfflineMode.Click += delegate
            {
                Adjust.SetOfflineMode(false);
            };

            btnEnableSDK.Click += delegate
            {
                Adjust.Enabled = true;
            };

            btnDisableSDK.Click += delegate
            {
                Adjust.Enabled = false;
            };

            btnIsSDKEnabled.Click += delegate
            {
                string message = Adjust.Enabled ? "SDK is ENABLED" : "SDK is DISABLED";
                Toast.MakeText(this, message, ToastLength.Short).Show();
            };

            btnGetIds.Click += delegate
            {
                Adjust.GetGoogleAdId(this, this);
                Console.WriteLine("Amazon Ad Id: " + Adjust.GetAmazonAdId(this));
                Console.WriteLine("Adid: " + Adjust.Adid);

                if (Adjust.Attribution != null)
                {
                    Console.WriteLine("Attribution Traker Token: " + Adjust.Attribution.TrackerToken);
                    Console.WriteLine("Attribution Traker Name: " + Adjust.Attribution.TrackerName);
                    Console.WriteLine("Attribution Network: " + Adjust.Attribution.Network);
                    Console.WriteLine("Attribution Campaign: " + Adjust.Attribution.Campaign);
                    Console.WriteLine("Attribution AdGroup: " + Adjust.Attribution.Adgroup);
                    Console.WriteLine("Attribution Creative: " + Adjust.Attribution.Creative);
                    Console.WriteLine("Attribution Click Label: " + Adjust.Attribution.ClickLabel);
                    Console.WriteLine("Attribution Adid: " + Adjust.Attribution.Adid);
                }
            };
        }
示例#7
0
 public void AddPartnerParameter(string key, string value)
 {
     nativeEvent.AddPartnerParameter(key, value);
 }