public void Simple() { var service = new DeleteRegistrationService { RequestBuilder = ServerRequestBuilder.Instance }; var request = new DeleteRegistrationRequest { DeviceToken = "ApplePushId" }; service.Execute(request, response => Debug.WriteLine("Success"), ExceptionHandler.Handle); }
public void Execute(DeleteRegistrationRequest request, Action<DeleteRegistrationResponse> responseCallback, Action<Exception> exceptionCallback) { var webRequest = RequestBuilder.Build("https://go.urbanairship.com/api/device_tokens/" + request.DeviceToken); webRequest.Method = "Delete"; var asyncRequest = new AsyncRequest { Request = webRequest, ReadFromResponse = o => responseCallback(new DeleteRegistrationResponse()), ExceptionCallback = exceptionCallback, RequestContentType = "application/json" }; asyncRequest.Execute(); }
public void Execute(DeleteRegistrationRequest request, Action <DeleteRegistrationResponse> responseCallback, Action <Exception> exceptionCallback) { var webRequest = RequestBuilder.Build("https://go.urbanairship.com/api/device_tokens/" + request.DeviceToken); webRequest.Method = "Delete"; webRequest.ContentType = "application/json"; var asyncRequest = new AsyncRequest { Request = webRequest, ReadFromResponse = o => responseCallback(new DeleteRegistrationResponse()), ExceptionCallback = exceptionCallback, }; asyncRequest.Execute(); }