public void Execute(GetRegistrationsRequest request, Action<GetRegistrationsResponse> responseCallback, Action<Exception> exceptionCallback) { var url = string.Format("https://go.urbanairship.com/api/device_tokens/?Limit={0}&start={1}", request.Limit, request.Start); var webRequest = RequestBuilder.Build(url); webRequest.Method = "GET"; webRequest.ContentType = "application/json"; var asyncRequest = new AsyncRequest { ReadFromResponse = stream => responseCallback(GetRegistrationsResponseDeSerializer.DeSerialize(stream)), Request = webRequest, ExceptionCallback = exceptionCallback, }; asyncRequest.Execute(); }
public void Integration() { var service = new GetRegistrationsService { RequestBuilder = RequestBuilderHelper.Build() }; var helper = new AsyncTestHelper<GetRegistrationsResponse>(); var request = new GetRegistrationsRequest(); service.Execute(request, helper.Callback, helper.HandleException); helper.Wait(); var response = helper.Response; foreach (var device in response.Devices) { Debug.WriteLine(device.DeviceToken); } }