Пример #1
0
        public static FcmNotification ForSingleRegistrationId(FcmNotification msg, string registrationId)
        {
            var result = new FcmNotification();

            result.Tag       = msg.Tag;
            result.MessageId = msg.MessageId;
            result.RegistrationIds.Add(registrationId);
            result.To               = null;
            result.CollapseKey      = msg.CollapseKey;
            result.Data             = msg.Data;
            result.DelayWhileIdle   = msg.DelayWhileIdle;
            result.ContentAvailable = msg.ContentAvailable;
            result.DryRun           = msg.DryRun;
            result.Priority         = msg.Priority;
            result.NotificationKey  = msg.NotificationKey;

            return(result);
        }
Пример #2
0
        public static FcmNotification ForSingleResult(FcmResponse response, int resultIndex)
        {
            var result = new FcmNotification();

            result.Tag       = response.OriginalNotification.Tag;
            result.MessageId = response.OriginalNotification.MessageId;

            if (response.OriginalNotification.RegistrationIds != null && response.OriginalNotification.RegistrationIds.Count >= (resultIndex + 1))
            {
                result.RegistrationIds.Add(response.OriginalNotification.RegistrationIds [resultIndex]);
            }

            result.CollapseKey      = response.OriginalNotification.CollapseKey;
            result.Data             = response.OriginalNotification.Data;
            result.DelayWhileIdle   = response.OriginalNotification.DelayWhileIdle;
            result.ContentAvailable = response.OriginalNotification.ContentAvailable;
            result.DryRun           = response.OriginalNotification.DryRun;
            result.Priority         = response.OriginalNotification.Priority;
            result.To = response.OriginalNotification.To;
            result.NotificationKey = response.OriginalNotification.NotificationKey;

            return(result);
        }
Пример #3
0
 public FcmNotificationException(FcmNotification notification, string msg) : base(msg, notification)
 {
     Notification = notification;
 }
Пример #4
0
 public FcmNotificationException(FcmNotification notification, string msg, string description) : base(msg, notification)
 {
     Notification = notification;
     Description  = description;
 }