diff --git a/cn.jpush.api/push/notification/AndroidNotification.cs b/cn.jpush.api/push/notification/AndroidNotification.cs index 3ebdcde..0be6bd0 100644 --- a/cn.jpush.api/push/notification/AndroidNotification.cs +++ b/cn.jpush.api/push/notification/AndroidNotification.cs @@ -1,166 +1,181 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace cn.jpush.api.push.notification -{ - public class AndroidNotification : PlatformNotification - { - public const string NOTIFICATION_ANDROID = "android"; - - private const string TITLE = "title"; - private const string BUILDER_ID = "builder_id"; - - [JsonProperty] - public string title { get; private set; } - - [JsonProperty] - public int builder_id { get; private set; } - - [JsonProperty] - public int priority { get; private set; } - - [JsonProperty] - public string category { get; private set; } - - [JsonProperty] - public int style { get; private set; } - - [JsonProperty] - public int alert_type { get; private set; } - - [JsonProperty] - public string big_text { get; private set; } - - [JsonProperty] - public string inbox { get; private set; } - - [JsonProperty] +using Newtonsoft.Json; +using System; +using System.Collections.Generic; + +namespace cn.jpush.api.push.notification +{ + public class AndroidNotification : PlatformNotification + { + public const string NOTIFICATION_ANDROID = "android"; + + private const string TITLE = "title"; + private const string BUILDER_ID = "builder_id"; + + [JsonProperty] + public string title { get; private set; } + + [JsonProperty] + public int builder_id { get; private set; } + + [JsonProperty] + public int priority { get; private set; } + + [JsonProperty] + public string category { get; private set; } + + [JsonProperty] + public int style { get; private set; } + + [JsonProperty] + public int alert_type { get; private set; } + + [JsonProperty] + public string big_text { get; private set; } + + [JsonProperty] + public string inbox { get; private set; } + + [JsonProperty] public string big_pic_path { get; private set; } // 华为 only - start /// /// 指定开发者想要打开的 Activity,值为 节点的 "android:name" 属性值。 - /// - [JsonProperty] - public string uri_activity { get; private set; } - - // 华为 only - end - - public AndroidNotification() : base() - { - title = null; - builder_id = 0; - } - - public AndroidNotification setTitle(string title) - { - this.title = title; - return this; - } - - public AndroidNotification setBuilderID(int builder_id) - { - this.builder_id = builder_id; - return this; - } - - public AndroidNotification setAlert(string alert) - { - this.alert = alert; - return this; - } - - public AndroidNotification setPriority(int priority) - { - this.priority = priority; - return this; - } - - public AndroidNotification setCategory(string category) - { - this.category = category; - return this; - } - - public AndroidNotification setStyle(int style) - { - this.style = style; - return this; - } - - public AndroidNotification setAlert_type(int alert_type) - { - this.alert_type = alert_type; - return this; - } - - public AndroidNotification setBig_text(string big_text) - { - this.big_text = big_text; - return this; - } - - public AndroidNotification setInbox(string inbox) - { - this.inbox = inbox; - return this; - } - - public AndroidNotification setBig_pic_path(string big_pic_path) - { - this.big_pic_path = big_pic_path; - return this; - } - + /// + [JsonProperty] + public string uri_activity { get; private set; } + + // 华为 only - end + + // oppo only - start + + /// + /// 指定开发者想要打开的 Activity,值为 节点的 "android:name" 属性值。 + /// + [JsonProperty] + public string uri_action { get; private set; } + + // oppo only - end + + public AndroidNotification() : base() + { + title = null; + builder_id = 0; + } + + public AndroidNotification setTitle(string title) + { + this.title = title; + return this; + } + + public AndroidNotification setBuilderID(int builder_id) + { + this.builder_id = builder_id; + return this; + } + + public AndroidNotification setAlert(string alert) + { + this.alert = alert; + return this; + } + + public AndroidNotification setPriority(int priority) + { + this.priority = priority; + return this; + } + + public AndroidNotification setCategory(string category) + { + this.category = category; + return this; + } + + public AndroidNotification setStyle(int style) + { + this.style = style; + return this; + } + + public AndroidNotification setAlert_type(int alert_type) + { + this.alert_type = alert_type; + return this; + } + + public AndroidNotification setBig_text(string big_text) + { + this.big_text = big_text; + return this; + } + + public AndroidNotification setInbox(string inbox) + { + this.inbox = inbox; + return this; + } + + public AndroidNotification setBig_pic_path(string big_pic_path) + { + this.big_pic_path = big_pic_path; + return this; + } + public AndroidNotification setUriActivity(string uri_activity) { this.uri_activity = uri_activity; return this; - } - - public AndroidNotification AddExtra(string key, string value) - { - if (extras == null) - { - extras = new Dictionary(); - } - if (value != null) - { - extras.Add(key, value); - } - return this; - } - - public AndroidNotification AddExtra(string key, int value) - { - if (extras == null) - { - extras = new Dictionary(); - } - extras.Add(key, value); - return this; - } - - public AndroidNotification AddExtra(string key, bool value) - { - if (extras == null) - { - extras = new Dictionary(); - } - extras.Add(key, value); - return this; - } - - public AndroidNotification AddExtra(string key, object value) - { - if (extras == null) - { - extras = new Dictionary(); - } - extras.Add(key, value); - return this; - } - } -} + } + public AndroidNotification setUriAction(string uri_action) + { + this.uri_action = uri_action; + return this; + } + + public AndroidNotification AddExtra(string key, string value) + { + if (extras == null) + { + extras = new Dictionary(); + } + if (value != null) + { + extras.Add(key, value); + } + return this; + } + + public AndroidNotification AddExtra(string key, int value) + { + if (extras == null) + { + extras = new Dictionary(); + } + extras.Add(key, value); + return this; + } + + public AndroidNotification AddExtra(string key, bool value) + { + if (extras == null) + { + extras = new Dictionary(); + } + extras.Add(key, value); + return this; + } + + public AndroidNotification AddExtra(string key, object value) + { + if (extras == null) + { + extras = new Dictionary(); + } + extras.Add(key, value); + return this; + } + } +}