Exemplo n.º 1
0
        public static MobileAppTracker InitializeValues(string advId, string advKey)
        {
            if (instance == null) {
                instance = new MobileAppTracker();
            }

            var hardwareId = HardwareIdentification.GetPackageSpecificToken(null).Id;
            var dataReader = DataReader.FromBuffer(hardwareId);
            byte[] bytes = new byte[hardwareId.Length];
            dataReader.ReadBytes(bytes);

            instance.parameters = new MATParameters(advId, advKey, bytes);

            instance.eventQueue = new MATEventQueue(instance.parameters);

            instance.GetUserAgent();

            // Indicates if the connection profile is registered for network status change events. Set the default value to FALSE.
            bool registeredNetworkStatusNotif = false;

            instance.networkStatusCallback = new NetworkStatusChangedEventHandler(instance.OnNetworkStatusChange);

            // Register for network status change notifications
            if (!registeredNetworkStatusNotif)
            {
                NetworkInformation.NetworkStatusChanged += instance.networkStatusCallback;
                registeredNetworkStatusNotif = true;
            }

            // Send queued requests
            instance.eventQueue.DumpQueue();

            return instance;
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
        public static MobileAppTracker InitializeValues(string advId, string advKey)
        {
            if (instance == null) {
                instance = new MobileAppTracker();
            }

            instance.urlEncrypter = new MATEncryption(advKey, MATConstants.IV);

            // Attached objects for attributes, queue functionality, and more
            instance.parameters = new MATParameters(advId, advKey);
            instance.eventQueue = new MATEventQueue(instance.parameters);

            // Add listener for network availability
            DeviceNetworkInformation.NetworkAvailabilityChanged += instance.DeviceNetworkInformation_NetworkAvailabilityChanged;

            // Check for Internet connectivity and send queued requests 
            if (DeviceNetworkInformation.IsNetworkAvailable)
            {
                instance.eventQueue.DumpQueue();
            }

            return instance;
        }
        public static MobileAppTracker InitializeValues(string advId, string advKey)
        {
            if (instance == null)
            {
                instance = new MobileAppTracker();
            }

            var hardwareId = HardwareIdentification.GetPackageSpecificToken(null).Id;
            var dataReader = DataReader.FromBuffer(hardwareId);

            byte[] bytes = new byte[hardwareId.Length];
            dataReader.ReadBytes(bytes);

            instance.parameters = new MATParameters(advId, advKey, bytes);

            instance.eventQueue = new MATEventQueue(instance.parameters);

            instance.GetUserAgent();

            // Indicates if the connection profile is registered for network status change events. Set the default value to FALSE.
            bool registeredNetworkStatusNotif = false;

            instance.networkStatusCallback = new NetworkStatusChangedEventHandler(instance.OnNetworkStatusChange);

            // Register for network status change notifications
            if (!registeredNetworkStatusNotif)
            {
                NetworkInformation.NetworkStatusChanged += instance.networkStatusCallback;
                registeredNetworkStatusNotif             = true;
            }

            // Send queued requests
            instance.eventQueue.DumpQueue();

            return(instance);
        }
        public static MobileAppTracker InitializeValues(string advId, string advKey)
        {
            if (instance == null)
            {
                instance = new MobileAppTracker();
            }

            instance.urlEncrypter = new MATEncryption(advKey, MATConstants.IV);

            // Attached objects for attributes, queue functionality, and more
            instance.parameters = new MATParameters(advId, advKey);
            instance.eventQueue = new MATEventQueue(instance.parameters);

            // Add listener for network availability
            DeviceNetworkInformation.NetworkAvailabilityChanged += instance.DeviceNetworkInformation_NetworkAvailabilityChanged;

            // Check for Internet connectivity and send queued requests
            if (DeviceNetworkInformation.IsNetworkAvailable)
            {
                instance.eventQueue.DumpQueue();
            }

            return(instance);
        }