示例#1
0
        /// <inheritDoc/>
        public INotifyResult Notify(string[] interests, string alertText, string webhook_url, WebhookLevel webhook_level)
        {
            NotifyBody nb = new NotifyBody();

            nb.interests           = interests;
            nb.apns.aps.alert.body = alertText;
            nb.webhook_url         = webhook_url;
            nb.webhook_level       = webhook_level.ToString();

            IRestResponse response = ExecuteNotify("/notifications", nb);
            NotifyResult  result   = new NotifyResult(response);

            return(result);
        }
示例#2
0
        /// <inheritDoc/>
        public INotifyResult Notify(string[] interests, Notification notification, string webhook_url, WebhookLevel webhook_level)
        {
            NotifyBody notifyBody = new NotifyBody();

            notifyBody.interests               = interests;
            notifyBody.apns.aps.notification   = notification;
            notifyBody.apns.aps.alert.body     = "New Message";
            notifyBody.apns.aps.alert.title    = notification.title;
            notifyBody.apns.aps.alert.subtitle = notification.subtitle;
            notifyBody.webhook_url             = webhook_url;
            notifyBody.webhook_level           = webhook_level.ToString();

            IRestResponse response = ExecuteNotify("/notifications", notifyBody);
            NotifyResult  result   = new NotifyResult(response);

            return(result);
        }