Esempio n. 1
0
        public void CustomEventSample()
        {
            MParticle.Start(new Configuration("API KEY", "API-SECRET"));

            var customEvent = new CustomEvent("My Custom Event Name", CustomEvent.CustomEventTypeEnum.Location)
            {
                CustomAttributes = new Dictionary <string, string>()
                {
                    { "foo", "bar" }
                }
            };
        }
        public async Task TestMParticleStartCorrectOptionsAsync()
        {
            await ExecuteOnUIThread(async() =>
            {
                await MParticle.StartAsync
                (
                    MParticleOptions.Builder("foo", "bar").Build()
                );
            });

            Assert.IsNotNull(MParticle.Instance);
        }
        public async Task TestLogEventAsync()
        {
            await ExecuteOnUIThread(async() =>
            {
                await MParticle.StartAsync
                (
                    MParticleOptions.Builder("foo", "bar").Build()
                );
            });


            CustomEvent customEvent = CustomEvent.Builder("foo").Build();

            MParticle.Instance.LogEvent(customEvent);
        }
        public async Task TestMParticleStartNoOptionsAsync()
        {
            Exception e = null;

            await ExecuteOnUIThread(async() =>
            {
                try
                {
                    await MParticle.StartAsync(null);
                }
                catch (Exception ex)
                {
                    e = ex;
                }
            });

            Assert.IsNotNull(e);
            Assert.AreEqual(typeof(InvalidOperationException), e.GetType());
        }
Esempio n. 5
0
        protected override void OnLaunched(LaunchActivatedEventArgs launchArgs)
        {
            // Create an Identity Request:
            // The SDK will automatically make an Identify() request during initialization,
            // if you know identities of the current-user, you should provide them.
            // Otherwise, the SDK will use the Identities of the most recent user.
            var identifyRequest = IdentityApiRequest.EmptyUser()
                                  .CustomerId("foo")
                                  .Email("bar")
                                  .Build();

            // Create an MParticleOptions object:
            // You must at least provide an mParticle workspace key and secret
            MParticleOptions options =
                MParticleOptions.Builder(apiKey: "REPLACE ME", apiSecret: "REPLACE ME")
                .IdentifyRequest(identifyRequest)
                .LaunchArgs(launchArgs)
                .Logger(new ExampleConsoleLogger())
                .Build();

            // Initialize the mParticle SDK:
            // You must do this prior to calling MParticle.Instance
            var task = MParticle.StartAsync(options);

            HandleIdentityTaskAsync(task);

            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                rootFrame = new Frame();
                Window.Current.Content = rootFrame;
            }

            if (launchArgs.PrelaunchActivated == false)
            {
                if (rootFrame.Content == null)
                {
                    rootFrame.Navigate(typeof(MainPage), launchArgs.Arguments);
                }
                Window.Current.Activate();
            }
        }
Esempio n. 6
0
 public void CreateApi()
 {
     MParticle.Start(new Configuration("API KEY", "API-SECRET"));
 }
Esempio n. 7
0
 public void Emit()
 {
     MParticle p = new MParticle();
 }
 public MParticleTests()
 {
     MParticle.Start(new Configuration("api_key", "api_secret"));
 }