/// <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); }
/// <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); }
public static ApplePush CreateAlert(ApplePushAlert alert, bool sendAsVoipType = false) => new ApplePush(sendAsVoipType ? ApplePushType.Voip : ApplePushType.Alert) { Alert = alert };
/// <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 };