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;
        }
 public static PushPayload PushSendSmsMessage()
 {
     var pushPayload = new PushPayload();
     pushPayload.platform = Platform.all();
     pushPayload.audience = Audience.all();
     pushPayload.notification = new Notification().setAlert(ALERT);
     SmsMessage sms_message = new SmsMessage();
     sms_message.setContent(SMSMESSAGE);
     sms_message.setDelayTime(DELAY_TIME);
     pushPayload.sms_message = sms_message;
     return pushPayload;
 }
Example #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;

            jSetting = new JsonSerializerSettings();
            jSetting.NullValueHandling    = NullValueHandling.Ignore;
            jSetting.DefaultValueHandling = DefaultValueHandling.Ignore;
        }