public async Task <bool> UpdatePushChannelAsync(UpdatePushChannel command) { var url = urlBuilder.UpdatePushChannel(); var response = await url.WithOAuthBearerToken(authToken).PutJsonAsync(command); return(response.IsSuccessStatusCode); }
private async Task UpdatePushChannelAsync(string newPushChannel) { if (newPushChannel == null) { return; } await RequestTokenIfNeededAsync(); var command = new UpdatePushChannel(); command.UserId = secureStorage.UserId; command.PushChannel = newPushChannel; try { bool updated = await client.UpdatePushChannelAsync(command); AppSettings.Instance.IsChannelUpdated = updated; } catch (Exception ex) { AppSettings.Instance.IsChannelUpdated = false; } }
public async Task <IActionResult> UpdatePushChannel([FromBody] UpdatePushChannel command) { await DispatchAsync(command); return(Ok()); }