コード例 #1
0
        public MainPage()
        {
            this.InitializeComponent();

            // Init MobileAppTracker
            mobileAppTracker = new MobileAppTracker("877", "8c14d6bbe466b65211e781d62e301eec");
            mobileAppTracker.AllowDuplicates = true;
            mobileAppTracker.DebugMode       = true;

            MyMATResponse response = new MyMATResponse();

            mobileAppTracker.SetMATResponse(response);
        }
コード例 #2
0
        public MainPage()
        {
            newTimer          = new DispatcherTimer();
            newTimer.Interval = TimeSpan.FromTicks(1);
            newTimer.Tick    += delegate { clock.Content = counter--; };
            newTimer.Start();

            this.InitializeComponent();

            // Init MobileAppTracker
            mat = MobileAppTracker.InitializeValues("877", "8c14d6bbe466b65211e781d62e301eec");
            mat.SetAllowDuplicates(true);
            mat.SetDebugMode(true);

            MyMATResponse response = new MyMATResponse();

            mat.SetMATResponse(response);
        }
コード例 #3
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            newTimer          = new DispatcherTimer();
            newTimer.Interval = TimeSpan.FromTicks(1);
            newTimer.Tick    += OnTimerTick;
            newTimer.Start();

            mat = MobileAppTracker.InitializeValues("877", "8c14d6bbe466b65211e781d62e301eec");
            mat.SetPackageName("com.hasofferstestapp");
            mat.SetAllowDuplicates(true);
            mat.SetDebugMode(true);

            MyMATResponse response = new MyMATResponse();

            mat.SetMATResponse(response);
        }
コード例 #4
0
ファイル: MainActivity.cs プロジェクト: kiyono-t/sdk-plugins
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            //Create the user interface in code
            var layout = new LinearLayout (this);
            layout.Orientation = Orientation.Vertical;

            // Get our button from the layout resource,
            // and attach an event to it
            var aButton = new Button (this);
            aButton.Text = "Start MobileAppTracker";
            aButton.Click += delegate {
                Log.Info (TAG, "MobileAppTracker constructor");

                mat = new MobileAppTracker (this, MAT_ADVERTISER_ID, MAT_CONVERSION_KEY);
            };
            layout.AddView (aButton);

            aButton = new Button (this);
            aButton.Text = "Toggle Debug Mode";
            aButton.Click += (sender, e) => {
                isDebug = !isDebug;

                Log.Info (TAG, "SetDebugMode = " + isDebug);

                mat.SetDebugMode(isDebug);
            };
            layout.AddView (aButton);

            aButton = new Button (this);
            aButton.Text = "Toggle Allow Duplicates";
            aButton.Click += (sender, e) => {
                isAllowDup = !isAllowDup;

                Log.Info (TAG, "SetAllowDuplicates = " + isAllowDup);

                mat.SetAllowDuplicates(isAllowDup);
            };
            layout.AddView (aButton);

            aButton = new Button (this);
            aButton.Text = "Test Install";
            aButton.Click += (sender, e) => {
                Log.Info (TAG, "TrackInstall");

                mat.TrackInstall();
            };
            layout.AddView (aButton);

            aButton = new Button (this);
            aButton.Text = "Test Update";
            aButton.Click += (sender, e) => {
                Log.Info (TAG, "TrackUpdate");

                mat.TrackUpdate();
            };
            layout.AddView (aButton);

            aButton = new Button (this);
            aButton.Text = "Test Event";
            aButton.Click += (sender, e) => {
                Log.Info (TAG, "Track Event");

                mat.TrackAction("event1");
            };
            layout.AddView (aButton);

            aButton = new Button (this);
            aButton.Text = "Test Event With Items";
            aButton.Click += (sender, e) => {
                Log.Info (TAG, "Track Event With Items");

                MATEventItem item1 = new MATEventItem("apple", 1, 0.99, 0.99);
                MATEventItem item2 = new MATEventItem("banana", "att1", "att2", "att3", "att4", "att5");

                List<MATEventItem> list = new List<MATEventItem>();
                list.Add(item1);
                list.Add(item2);

                mat.TrackAction("checkout", list);
            };
            layout.AddView (aButton);

            aButton = new Button (this);
            aButton.Text = "Test Setters";
            aButton.Click += (sender, e) => {
                Log.Info (TAG, "Test Setters");

                mat.PackageName = "com.abc.xyz";
                mat.SiteId = "12345";
                mat.UserId = "user123";
                mat.TRUSTeId = "truste123";
                mat.RefId = "ref123";
                mat.Latitude = 1.23;
                mat.Longitude = 12.3;
                mat.Altitude = 123.4;
                mat.AdvertiserId = "5432";
                mat.Gender = MobileAppTracker.GenderFemale;
                mat.CurrencyCode = "RUB";
                mat.Age = 23;

                mat.SetFacebookUserId("tempFacebookId");
                mat.SetGoogleUserId("tempGoogleId");
                mat.SetTwitterUserId("tempTwitterId");

                String matData = "\nPackageName = " + mat.PackageName
                                + "\nSiteId = " + mat.SiteId
                                + "\nUserId = " + mat.UserId
                                + "\nTRUSTeId = " + mat.TRUSTeId
                                + "\nRefId = " + mat.RefId
                                + "\nLatitude = " + mat.Latitude
                                + "\nLongitude = " + mat.Longitude
                                + "\nAltitude = " + mat.Altitude
                                + "\nAdvertiserId = " + mat.AdvertiserId
                                + "\nGender = " + mat.Gender
                                + "\nCurrencyCode = " + mat.CurrencyCode
                                + "\nAge = " + mat.Age;

                Log.Info (TAG, "MAT Data: " + matData);
            };
            layout.AddView (aButton);

            SetContentView (layout);
        }
コード例 #5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            //Create the user interface in code
            var layout = new LinearLayout(this);

            layout.Orientation = Orientation.Vertical;

            // Get our button from the layout resource,
            // and attach an event to it
            var aButton = new Button(this);

            aButton.Text   = "Start MobileAppTracker";
            aButton.Click += delegate {
                Log.Info(TAG, "MobileAppTracker constructor");

                MobileAppTracker.Init(this.ApplicationContext, MAT_ADVERTISER_ID, MAT_CONVERSION_KEY);
            };
            layout.AddView(aButton);

            aButton        = new Button(this);
            aButton.Text   = "Toggle Debug Mode";
            aButton.Click += (sender, e) => {
                isDebug = !isDebug;

                Log.Info(TAG, "SetDebugMode = " + isDebug);

                MobileAppTracker.Instance.SetDebugMode(isDebug);
            };
            layout.AddView(aButton);

            aButton        = new Button(this);
            aButton.Text   = "Toggle Allow Duplicates";
            aButton.Click += (sender, e) => {
                isAllowDup = !isAllowDup;

                Log.Info(TAG, "SetAllowDuplicates = " + isAllowDup);

                MobileAppTracker.Instance.SetAllowDuplicates(isAllowDup);
            };
            layout.AddView(aButton);

            aButton        = new Button(this);
            aButton.Text   = "Test Session";
            aButton.Click += (sender, e) => {
                Log.Info(TAG, "MeasureSession");

                MobileAppTracker.Instance.MeasureSession();
            };
            layout.AddView(aButton);


            aButton        = new Button(this);
            aButton.Text   = "Test Event";
            aButton.Click += (sender, e) => {
                Log.Info(TAG, "Measure Event");

                MobileAppTracker.Instance.MeasureAction("event1");
            };
            layout.AddView(aButton);

            aButton        = new Button(this);
            aButton.Text   = "Test Event With Items";
            aButton.Click += (sender, e) => {
                Log.Info(TAG, "Measure Event With Items");

                MATEventItem item1 = new MATEventItem("apple", 1, 0.99, 0.99);
                MATEventItem item2 = new MATEventItem("banana", "attr1", "attr2", "attr3", "attr4", "attr5");

                List <MATEventItem> list = new List <MATEventItem>();
                list.Add(item1);
                list.Add(item2);

                MobileAppTracker.Instance.MeasureAction("checkout", list, 0, null, null);
            };
            layout.AddView(aButton);

            aButton        = new Button(this);
            aButton.Text   = "Test Setters";
            aButton.Click += (sender, e) => {
                Log.Info(TAG, "Test Setters");

                MobileAppTracker.Instance.PackageName  = "com.abc.xyz";
                MobileAppTracker.Instance.SiteId       = "12345";
                MobileAppTracker.Instance.UserId       = "user123";
                MobileAppTracker.Instance.TRUSTeId     = "truste123";
                MobileAppTracker.Instance.Latitude     = 1.23;
                MobileAppTracker.Instance.Longitude    = 12.3;
                MobileAppTracker.Instance.Altitude     = 123.4;
                MobileAppTracker.Instance.Gender       = MobileAppTracker.GenderFemale;
                MobileAppTracker.Instance.CurrencyCode = "RUB";
                MobileAppTracker.Instance.Age          = 23;
                MobileAppTracker.Instance.ExistingUser = false;
                MobileAppTracker.Instance.IsPayingUser = true;
                MobileAppTracker.Instance.UserEmail    = "*****@*****.**";
                MobileAppTracker.Instance.UserName     = "******";
                MobileAppTracker.Instance.SetGoogleAdvertisingId("12345678-1234-1234-1234-123456789012", false);

                MobileAppTracker.Instance.FacebookUserId = "tempFacebookId";
                MobileAppTracker.Instance.GoogleUserId   = "tempGoogleId";
                MobileAppTracker.Instance.TwitterUserId  = "tempTwitterId";

                String matData = "\nPackageName = " + MobileAppTracker.Instance.PackageName
                                 + "\nSiteId = " + MobileAppTracker.Instance.SiteId
                                 + "\nUserId = " + MobileAppTracker.Instance.UserId
                                 + "\nTRUSTeId = " + MobileAppTracker.Instance.TRUSTeId
                                 + "\nRefId = " + MobileAppTracker.Instance.RefId
                                 + "\nLatitude = " + MobileAppTracker.Instance.Latitude
                                 + "\nLongitude = " + MobileAppTracker.Instance.Longitude
                                 + "\nAltitude = " + MobileAppTracker.Instance.Altitude
                                 + "\nAdvertiserId = " + MobileAppTracker.Instance.AdvertiserId
                                 + "\nGender = " + MobileAppTracker.Instance.Gender
                                 + "\nCurrencyCode = " + MobileAppTracker.Instance.CurrencyCode
                                 + "\nAge = " + MobileAppTracker.Instance.Age;

                Log.Info(TAG, "MAT Data: " + matData);
            };
            layout.AddView(aButton);

            aButton        = new Button(this);
            aButton.Text   = "Test Getters";
            aButton.Click += (sender, e) => {
                Log.Info(TAG, "Test Getters");

                String matId     = MobileAppTracker.Instance.MatId;
                String openLogId = MobileAppTracker.Instance.OpenLogId;
                bool   isPaying  = MobileAppTracker.Instance.IsPayingUser;

                String matData = "\nMatId = " + matId
                                 + "\nOpenLogId = " + openLogId
                                 + "\nIsPayingUser = " + isPaying;

                Log.Info(TAG, matData);
            };
            layout.AddView(aButton);

            SetContentView(layout);
        }
コード例 #6
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            btnStart.TouchUpInside += delegate {
                MobileAppTracker.InitTracker(MAT_ADVERTISER_ID, MAT_CONVERSION_KEY);
                MobileAppTracker.SetPackageName(MAT_PACKAGE_NAME);
                MobileAppTracker.SetAppleAdvertisingIdentifier(ASIdentifierManager.SharedManager.AdvertisingIdentifier, ASIdentifierManager.SharedManager.IsAdvertisingTrackingEnabled);

                MobileAppTracker.CheckForDeferredDeeplinkWithTimeout(0.75); // 0.75 sec

                MobileAppTracker.SetFacebookEventLogging(true, false);

                Console.WriteLine("MAT Tracker Started : adv id = {0}, conv key = {1}, package name = {2}", MAT_ADVERTISER_ID, MAT_CONVERSION_KEY, MAT_PACKAGE_NAME);
            };

            btnDelegate.TouchUpInside += delegate {
                Console.WriteLine("matDelegate = " + matDelegate);
                MobileAppTracker.SetDelegate(matDelegate);
            };

            btnDebug.TouchUpInside += delegate {
                MobileAppTracker.SetDebugMode(true);
            };

            btnAllowDup.TouchUpInside += delegate {
                MobileAppTracker.SetAllowDuplicates(true);
            };

            btnSession.TouchUpInside += delegate {
                MobileAppTracker.MeasureSession();
            };

            btnAction.TouchUpInside += delegate {
                MobileAppTracker.MeasureAction("eventAction1");
                MobileAppTracker.MeasureAction("eventAction2", "ref1");
                MobileAppTracker.MeasureAction("eventAction3", "ref2", 1.99f, "GBP");

                MobileAppTracker.MeasureAction(932851438);
                MobileAppTracker.MeasureAction(932851438, "ref3");
                MobileAppTracker.MeasureAction(932851438, "ref4", 1.99f, "GBP");
            };

            btnActionWithItems.TouchUpInside += delegate {
                MATEventItem item1 = MATEventItem.EventItemWithName("item1", 0.99f, 1, 0.99f, "1", "2", "3", "4", "5");
                MATEventItem item2 = MATEventItem.EventItemWithName("item2", 0.50f, 2, 1.0f);

                MobileAppTracker.MeasureAction("eventItems", new MATEventItem[] { item1, item2 });
                MobileAppTracker.MeasureAction("eventItems", new MATEventItem[] { item1, item2 }, "ref5");
                MobileAppTracker.MeasureAction("eventItems", new MATEventItem[] { item1, item2 }, "ref6", 0.89f, "CAD", 0);

                MobileAppTracker.MeasureAction(932851438, new MATEventItem[] { item1, item2 });
                MobileAppTracker.MeasureAction(932851438, new MATEventItem[] { item1, item2 }, "ref7");
                MobileAppTracker.MeasureAction(932851438, new MATEventItem[] { item1, item2 }, "ref8", 0.89f, "CAD", 0);
            };

            btnActionWithReceipt.TouchUpInside += delegate {
                MATEventItem item1 = MATEventItem.EventItemWithName("item1", 0.99f, 1, 0.99f, "6", "7", "8", "9", "10");
                MATEventItem item2 = MATEventItem.EventItemWithName("item2", 0.50f, 2, 1.0f);

                MobileAppTracker.MeasureAction("eventReceipt", new MATEventItem[] { item1, item2 }, "ref9", 132.6f, "RUB", 0, NSData.FromString(GetSampleiTunesIAPReceipt()));

                MobileAppTracker.MeasureAction(932851438, new MATEventItem[] { item1, item2 }, "ref10", 132.6f, "RUB", 0, NSData.FromString(GetSampleiTunesIAPReceipt()));
            };

            btnSetterMethods.TouchUpInside += delegate {
                Console.WriteLine("MAT setter methods");

                MobileAppTracker.SetTRUSTeId("tempTrusteTPID");
                MobileAppTracker.SetUserId("tempUserId");
                MobileAppTracker.SetUserEmail("*****@*****.**");
                MobileAppTracker.SetUserName("tempUserName");
                MobileAppTracker.SetCurrencyCode("GBP");
                MobileAppTracker.SetGender(1);
                MobileAppTracker.SetLocation(1.1, 2.2);
                MobileAppTracker.SetLocationWithAltitude(3.3, 4.4, 5.5);
                MobileAppTracker.SetUseCookieTracking(false);
                MobileAppTracker.SetUseCookieTracking(false);
                MobileAppTracker.SetAppAdTracking(true);
                MobileAppTracker.SetAge(23);
                MobileAppTracker.SetJailbroken(false);
                MobileAppTracker.SetAppleAdvertisingIdentifier(ASIdentifierManager.SharedManager.AdvertisingIdentifier, ASIdentifierManager.SharedManager.IsAdvertisingTrackingEnabled);
                MobileAppTracker.SetAppleVendorIdentifier(new NSUuid("12345678-1234-1234-1234-123456789012"));
                MobileAppTracker.SetFacebookUserId("tempFacebookId");
                MobileAppTracker.SetGoogleUserId("tempGoogleId");
                MobileAppTracker.SetTwitterUserId("tempTwitterId");

                MobileAppTracker.SetEventAttribute1("attr1");
                MobileAppTracker.SetEventAttribute2("attr2");
                MobileAppTracker.SetEventAttribute3("attr3");
                MobileAppTracker.SetEventAttribute4("attr4");
                MobileAppTracker.SetEventAttribute5("attr5");

                MobileAppTracker.SetEventContentType("testContentType");
                MobileAppTracker.SetEventContentId("testContentId");
                MobileAppTracker.SetEventDate1(NSDate.Now);
                MobileAppTracker.SetEventDate2(NSDate.Now.AddSeconds(60));
                MobileAppTracker.SetEventLevel(3);
                MobileAppTracker.SetEventQuantity(2);
                MobileAppTracker.SetEventRating(4.5f);
                MobileAppTracker.SetEventSearchString("testSearchString");

                MobileAppTracker.SetExistingUser(false);
                MobileAppTracker.SetFacebookEventLogging(true, false);
                MobileAppTracker.SetPayingUser(false);
            };

            btnGetterMethods.TouchUpInside += delegate {
                Console.WriteLine("MatId        = " + MobileAppTracker.MatId);
                Console.WriteLine("OpenLogId    = " + MobileAppTracker.OpenLogId);
                Console.WriteLine("IsPayingUser = " + MobileAppTracker.IsPayingUser);
            };
        }
コード例 #7
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            // Perform any additional setup after loading the view, typically from a nib.

            btnStart.TouchUpInside += delegate {
                mat = MobileAppTracker.SharedManager;
                mat.InitTracker(MAT_ADVERTISER_ID, MAT_CONVERSION_KEY);
                mat.SetPackageName(MAT_PACKAGE_NAME);

                mat.Delegate = new TestMATDelegate();

                Console.WriteLine("MAT Tracker Started : adv id = {0}, conv key = {1}, package name = {2}", MAT_ADVERTISER_ID, MAT_CONVERSION_KEY, MAT_PACKAGE_NAME);
                Console.WriteLine("MAT SDK Data Params = " + mat.SdkDataParameters.ToString());
            };

            btnDebug.TouchUpInside += delegate {
                isDebugEnabled = !isDebugEnabled;
                mat.SetDebugMode(isDebugEnabled);
            };

            btnAllowDup.TouchUpInside += delegate {
                isAllowDuplicatesEnabled = !isAllowDuplicatesEnabled;
                mat.SetAllowDuplicates(isAllowDuplicatesEnabled);
            };

            btnPrintSDKParams.TouchUpInside += delegate {
                Console.WriteLine("MAT SDK Data Params = " + mat.SdkDataParameters.ToString());
            };

            btnInstall.TouchUpInside += delegate {
                mat.TrackInstall();
            };

            btnUpdate.TouchUpInside += delegate {
                mat.TrackUpdateWithReferenceId("ref11");
            };

            btnAction.TouchUpInside += delegate {
                mat.TrackAction("eventAction", false, "ref1", 1.99f, "GBP");
            };

            btnActionWithItems.TouchUpInside += delegate {

                MATEventItem item1 = MATEventItem.EventItemWithName("item1", 0.99f, 1, 0.99f, "1", "2", "3", "4", "5");
                MATEventItem item2 = MATEventItem.EventItemWithName("item2", 0.50f, 2, 1.0f);

                mat.TrackActionWithItems("eventItems", false, new MATEventItem[]{item1, item2}, "ref2", 0.89f, "CAD", 0);
            };

            btnActionWithReceipt.TouchUpInside += delegate {

                MATEventItem item1 = MATEventItem.EventItemWithName("item1", 0.99f, 1, 0.99f, "6", "7", "8", "9", "10");
                MATEventItem item2 = MATEventItem.EventItemWithName("item2", 0.50f, 2, 1.0f);

                mat.TrackActionWithReceipt("eventReceipt", false, new MATEventItem[]{item1, item2}, "ref3", 132.6f, "RUB", 0, GetSampleiTunesIAPReceipt());
            };

            btnSetterMethods.TouchUpInside += delegate {

                Console.WriteLine("MAT SDK Data Params before calling setters = " + mat.SdkDataParameters.ToString());

                mat.SetODIN1("tempODIN1");
                mat.SetOpenUDID("tempOpenUDID");
                mat.SetMACAddress("tempMACAddress");
                mat.SetTrusteTPID("tempTrusteTPID");
                mat.SetUserId("tempUserId");
                mat.SetUIID("tempUIID");
                mat.SetCurrencyCode("tempCurrencyCode");
                mat.SetGender(1);
                mat.SetLocation(1.1,2.2);
                mat.SetLocationWithAltitude(3.3,4.4,5.5);
                mat.SetUseCookieTracking(false);
                mat.SetUseCookieTracking(false);
                mat.SetAppAdTracking(true);
                mat.SetAge(23);
                mat.SetJailbroken(false);
                mat.SetMATAdvertiserId("tempMATAdvId");
                mat.SetMATConversionKey("tempMATConvKey");
                mat.SetAppleAdvertisingIdentifier(new NSUuid("12345678-1234-1234-1234-123456789012"));
                mat.SetAppleVendorIdentifier(new NSUuid("12345678-1234-1234-1234-123456789012"));

                Console.WriteLine("MAT SDK Data Params after calling setters = " + mat.SdkDataParameters.ToString());
            };
        }
コード例 #8
0
 public override void MobileAppTrackerDidSucceed(MobileAppTracker tracker, NSData data)
 {
     Console.WriteLine ("MAT DidSucceed: " + data.ToString ());
 }
コード例 #9
0
 public override void MobileAppTrackerDidFail(MobileAppTracker tracker, NSError error)
 {
     Console.WriteLine ("MAT DidFail: " + error.ToString());
 }