예제 #1
0
 /// <summary>
 /// Add alert to the payload.
 /// </summary>
 /// <param name="title">Alert title. Can be null.</param>
 /// <param name="body">Alert body. <b>Cannot be null.</b></param>
 /// <returns></returns>
 public ApplePush AddAlert([CanBeNull] string title, [NotNull] string body)
 {
     Alert = new ApplePushAlert(title, body);
     if (title == null)
     {
         _sendAlertAsText = true;
     }
     return(this);
 }
예제 #2
0
 /// <summary>
 /// Add alert to the payload.
 /// </summary>
 /// <param name="title">Alert title. Can be null.</param>
 /// <param name="body">Alert body. <b>Cannot be null.</b></param>
 /// <returns></returns>
 public ApplePush AddAlert(string title = null, string body = null)
 {
     Alert = new ApplePushAlert(title, body);
     if (title == null)
     {
         _sendAlertAsText = true;
     }
     return(this);
 }
예제 #3
0
 public static ApplePush CreateAlert(ApplePushAlert alert, bool sendAsVoipType = false) =>
 new ApplePush(sendAsVoipType ? ApplePushType.Voip : ApplePushType.Alert)
 {
     Alert = alert
 };
예제 #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="alert"></param>
 /// <param name="sendAsVoipType">True if push must be sent with 'voip' type rather than 'alert'.</param>
 /// <returns></returns>
 public static ApplePush CreateAlert(ApplePushAlert alert, bool sendAsVoipType = false) =>
 new ApplePush()
 {
     Alert = alert, _sendAsVoipType = sendAsVoipType
 };