/// <summary> /// Process the general toast message /// </summary> /// <param name="obj"></param> /// <returns></returns> internal async Task SendToastMessage(ToastNotificationTriggerDetails _tntd, P3bble.Constants.Icons Icon) { try { String Header = _tntd.AppDisplayName; String Details = ""; if (_tntd.Text1.Length > 0) { Details += _tntd.Text1 + Environment.NewLine; } if (_tntd.Text2.Length > 0) { Details += _tntd.Text2 + Environment.NewLine; } if (_tntd.Text3.Length > 0) { Details += _tntd.Text3 + Environment.NewLine; } if (_tntd.Text4.Length > 0) { Details += _tntd.Text4; } await SendToastMessageToPebble(Header, Details, Icon); } catch (Exception) { } }
/// <summary> /// Send the toast message to the Pebble /// </summary> /// <param name="Header"></param> /// <param name="Details"></param> /// <param name="Icon"></param> /// <returns></returns> internal async Task SendToastMessageToPebble(String Header, String Details, P3bble.Constants.Icons Icon) { try { //Send Message P3bble.Messages.NotificationMessage _nm = new P3bble.Messages.NotificationMessage(_pc.GetNextMessageIdentifier(), Guid.NewGuid(), DateTime.Now, Header, Details, Icon); await _pc.Pebble.WriteMessageAndReceiveAcknowledgementAsync(_nm); } catch (Exception) { } }