public async Task <bool> UpdateChat(ChatProperty chp) { Boolean chatstatus = false; HttpClient httpClient = new HttpClient(); Uri uri = new Uri("http://beam.gear.host/api/Chat"); string json = JsonConvert.SerializeObject(chp, Formatting.Indented); var content = new StringContent(json, Encoding.UTF8, "application/json"); var response = await httpClient.PostAsync(uri, content); if (response.IsSuccessStatusCode) { string res = await response.Content.ReadAsStringAsync(); if (res == "0") { chatstatus = false; } else //success { chatstatus = true; } } return(chatstatus); }
public ChatDetail(string RequestId, string FromId, string ToId) { InitializeComponent(); chatProperty = new ChatProperty(); chatProperty.RequestId = Convert.ToInt32(RequestId); chatProperty.FromId = Convert.ToInt32(FromId); chatProperty.ToId = Convert.ToInt32(ToId); refreshChatUi(); int intervalInSeconds = 5; Device.StartTimer(TimeSpan.FromSeconds(intervalInSeconds), () => { Device.BeginInvokeOnMainThread(() => refreshChatUi()); return(true); }); //GetChatDetails(RequestId,FromId,ToId); }
set => SetValue(ChatProperty, value);