public void Multiple()
 {
     var service = new RemoveTagFromDeviceService
                       {
                           RequestBuilder = ServerRequestBuilder.Instance
                       };
     var request = new RemoveTagFromDeviceRequest
                       {
                           DeviceToken = "DeviceToken",
                           TagToRemove = "tag1"
                       };
     service.Execute(request, response => Debug.WriteLine("Deleted"), ExceptionHandler.Handle);
 }
        public void Execute(RemoveTagFromDeviceRequest request, Action<RemoveTagFromDeviceResponse> responseCallback, Action<Exception> exceptionCallback)
        {
            var url = string.Format("https://go.urbanairship.com/api/device_tokens/{0}/tags/{1}", request.DeviceToken, request.TagToRemove);
            var webRequest = RequestBuilder.Build(url);
            webRequest.Method = "DELETE";
            webRequest.ContentType = "application/json";

            var asyncRequest = new AsyncRequest
            {
                Request = webRequest,
                ReadFromResponse = o => responseCallback(new RemoveTagFromDeviceResponse()),
                ExceptionCallback = exceptionCallback,
            };
            asyncRequest.Execute();
        }
        public void Tags()
        {
            var service = new RemoveTagFromDeviceService
                              {
                                  RequestBuilder = RequestBuilderHelper.Build()
                              };

            var helper = new AsyncTestHelper();
            var request = new RemoveTagFromDeviceRequest
                              {
                                  DeviceToken = "DeviceId",
                                  TagToRemove = "tag1434"
                              };
            service.Execute(request, response => helper.Callback(null), helper.HandleException);
            helper.Wait();
        }
Example #4
0
        public void Execute(RemoveTagFromDeviceRequest request, Action <RemoveTagFromDeviceResponse> responseCallback, Action <Exception> exceptionCallback)
        {
            var url        = string.Format("https://go.urbanairship.com/api/device_tokens/{0}/tags/{1}", request.DeviceToken, request.TagToRemove);
            var webRequest = RequestBuilder.Build(url);

            webRequest.Method      = "DELETE";
            webRequest.ContentType = "application/json";

            var asyncRequest = new AsyncRequest
            {
                Request           = webRequest,
                ReadFromResponse  = o => responseCallback(new RemoveTagFromDeviceResponse()),
                ExceptionCallback = exceptionCallback,
            };

            asyncRequest.Execute();
        }