private void SendToMobilePushServers(MobilePushNotification notification, vMobilePushTemplate template) { // sending as a mobile push if (template.MobilePushDeliveryTypeID == (byte)EntityEnums.MobilePushDeliveryType.MobileOnly || template.MobilePushDeliveryTypeID == (byte)EntityEnums.MobilePushDeliveryType.WebAndMobile) { var msg = new UTD.Tricorder.Common.NotificationSystem.MobileNotificationMessage(); TemplateParams tp = TemplateParams.FromSerializedString(notification.TemplateParamsJSON); msg.Alert = tp.ProcessTemplate(template.AlertText); msg.Sound = template.SoundFileName; msg.TimeToLiveSeconds = template.TimeToLiveSeconds; msg.IsOneSufficient = template.IsOneSufficient; msg.ParamsJSON = notification.ParamsJSON; msg.Title = tp.ProcessTemplate(template.Title); msg.Type = new Common.NotificationSystem.MobileNotificationTypeSEnum(template.MobileNotificationTypeName); msg.DelayWhileIdle = template.DelayWhileIdle; PushNotification(notification.ReceiverUserID.Value, msg); } }
public void Send(MobilePushNotification notification, vMobilePushTemplate template) { Check.Require(notification != null); Check.Require(template != null); if (notification.ReceiverUserID.HasValue) { if (template.MobilePushDeliveryTypeID == (byte)EntityEnums.MobilePushDeliveryType.WebAndMobile || template.MobilePushDeliveryTypeID == (byte)EntityEnums.MobilePushDeliveryType.WebOnly) { SendToUser(notification.ReceiverUserID.Value, template.MobileNotificationTypeName, notification.ParamsJSON); } else { throw new NotImplementedException(); } // SendNeedAckToUser(notification.ReceiverUserID.Value, template.MobileNotificationTypeName, notification.ParamsJSON, notification.MobilePushNotificationID); } else { throw new NotImplementedException(); } }
/// <summary> /// Sends to signal r client. /// </summary> /// <param name="entitySet">The entity set.</param> /// <param name="notification">The notification.</param> /// <param name="template">The template.</param> private static void SendToSignalRClient(object entitySet, MobilePushNotification notification, vMobilePushTemplate template) { // sending realtime to web client SignalRPushSender.Send(notification, template); }