Пример #1
0
        public PushPayload(Platform platform, Audience audience, Message message , Options options = null)
        {
            Debug.Assert(platform != null);
            Debug.Assert(audience != null);
            Debug.Assert(message != null);

            this.platform = platform;
            this.audience = audience;
            this.message = message;
            this.options = options;

            jSetting = new JsonSerializerSettings();
            jSetting.NullValueHandling = NullValueHandling.Ignore;
            jSetting.DefaultValueHandling = DefaultValueHandling.Ignore;
        }
Пример #2
0
        public PushPayload(Platform platform, Audience audience, Notification notification, Message message = null, SmsMessage sms_message = null, Options options = null)
        {
            Debug.Assert(platform != null);
            Debug.Assert(audience != null);
            Debug.Assert(notification != null || message != null);

            this.platform = platform;
            this.audience = audience;
            this.notification = notification;
            this.message = message;
            this.sms_message = sms_message;
            this.options = options;

            jSetting = new JsonSerializerSettings();
            jSetting.NullValueHandling = NullValueHandling.Ignore;
            jSetting.DefaultValueHandling = DefaultValueHandling.Ignore;
        }
Пример #3
0
        public PushPayload(
            Platform platform,
            Audience audience,
            Notification notification,
            Message message        = null,
            SmsMessage sms_message = null,
            Options options        = null)
        {
            Debug.Assert(platform != null);
            Debug.Assert(audience != null);
            Debug.Assert(notification != null || message != null);
            this.platform     = platform;
            this.audience     = audience;
            this.notification = notification;
            this.message      = message;
            this.sms_message  = sms_message;
            this.options      = options;
            JsonSerializerSettings serializerSettings = new JsonSerializerSettings();

            serializerSettings.NullValueHandling    = NullValueHandling.Ignore;
            serializerSettings.DefaultValueHandling = DefaultValueHandling.Ignore;
            this.jSetting = serializerSettings;
        }
Пример #4
0
 public static PushPayload MessageAll(string msgContent)
 {
     return(new PushPayload(Platform.all(), Audience.all(), (Notification)null, Message.content(msgContent), (SmsMessage)null, new Options()));
 }
Пример #5
0
 public static PushPayload AlertAll(string alert)
 {
     return(new PushPayload(Platform.all(), Audience.all(), new Notification().setAlert(alert), (Message)null, (SmsMessage)null, new Options()));
 }