public void Simple()
        {
            var service = new GetRegistrationService
            {
                RequestBuilder = RequestBuilderHelper.Build()
            };


            var helper = new AsyncTestHelper <GetRegistrationResponse>();
            var getRegistrationRequest = new GetRegistrationRequest
            {
                DeviceToken = RemoteSettings.AppleDeviceId
            };

            service.Execute(getRegistrationRequest, helper.Callback, helper.HandleException);
            helper.Wait();

            var registration = helper.Response;

            Debug.WriteLine(registration.Alias);
            Debug.WriteLine(registration.Badge);
            Debug.WriteLine(registration.QuietTime.Start);
            Debug.WriteLine(registration.QuietTime.End);
            Debug.WriteLine(string.Join(" ", registration.Tags));
            Debug.WriteLine(registration.TimeZone);
        }
예제 #2
0
        public void Simple()
        {
            var service = new GetRegistrationService
            {
                RequestBuilder = ServerRequestBuilder.Instance
            };
            var request = new GetRegistrationRequest {
                PushId = "AndroidPushId"
            };

            service.Execute(request, Callback, ExceptionHandler.Handle);
        }
        public void Tags()
        {
            var service = new GetRegistrationService
            {
                RequestBuilder = ServerRequestBuilder.Instance
            };
            var request = new GetRegistrationRequest
            {
                DeviceToken = "ApplePushId"
            };

            service.Execute(request, Callback, ExceptionHandler.Handle);
        }
        public void Simple()
        {
            var service = new GetRegistrationService
            {
                RequestBuilder = RequestBuilderHelper.Build()
            };
            var helper  = new AsyncTestHelper <GetRegistrationResponse>();
            var request = new GetRegistrationRequest
            {
                PushId = RemoteSettings.AndroidPushId
            };

            service.Execute(request, helper.Callback, helper.HandleException);
            helper.Wait();
        }
        public void NotFound()
        {
            var service = new GetRegistrationService
            {
                RequestBuilder = RequestBuilderHelper.Build()
            };


            var helper = new AsyncTestHelper <GetRegistrationResponse>();
            var getRegistrationRequest = new GetRegistrationRequest
            {
                DeviceToken = "foo"
            };

            service.Execute(getRegistrationRequest, helper.Callback, helper.HandleException);
            helper.Wait();
            Assert.IsNull(helper.Response);
        }