Skip to content

Commit

Permalink
Merge pull request #40 from jpush/feature/20211208_addCallBackAndNoti…
Browse files Browse the repository at this point in the history
…fication3rd

Feature/20211208 add call back and notification3rd
  • Loading branch information
Curacao-1 committed Dec 16, 2021
2 parents 5b545c0 + 49dfee2 commit e51c825
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Jiguang.JPush/Model/CallBack.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Newtonsoft.Json;
using System.Collections.Generic;

namespace Jiguang.JPush.Model
{
/// <summary>
/// <see cref="https://docs.jiguang.cn/jpush/server/push/rest_api_v3_push/#callback"/>
/// </summary>
public class CallBack
{
[JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)]
public string Url { get; set; }

[JsonProperty("params", NullValueHandling = NullValueHandling.Ignore)]
public Dictionary<string, object> Params { get; set; }

[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
public int Type { get; set; }
}
}
41 changes: 41 additions & 0 deletions Jiguang.JPush/Model/Notification3rd.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Newtonsoft.Json;
using System.Collections.Generic;

namespace Jiguang.JPush.Model
{
/// <summary>
/// <see cref="https://docs.jiguang.cn/jpush/server/push/rest_api_v3_push/#notification_3rd"/>
/// </summary>
public class Notification3rd
{
[JsonProperty("title", NullValueHandling = NullValueHandling.Ignore)]
public string Url { get; set; }

/// <summary>
/// 必填。
/// </summary>
[JsonProperty("content", NullValueHandling = NullValueHandling.Ignore)]
public string Content { get; set; }

[JsonProperty("channel_id", NullValueHandling = NullValueHandling.Ignore)]
public string ChannelId { get; set; }

[JsonProperty("uri_activity", NullValueHandling = NullValueHandling.Ignore)]
public string UriActivity { get; set; }

[JsonProperty("uri_action", NullValueHandling = NullValueHandling.Ignore)]
public string UriAction { get; set; }

[JsonProperty("badge_add_num", NullValueHandling = NullValueHandling.Ignore)]
public string BadgeAddNum { get; set; }

[JsonProperty("badge_class", NullValueHandling = NullValueHandling.Ignore)]
public string BadgeClass { get; set; }

[JsonProperty("sound", NullValueHandling = NullValueHandling.Ignore)]
public string Sound { get; set; }

[JsonProperty("extras", NullValueHandling = NullValueHandling.Ignore)]
public Dictionary<string, object> Extras { get; set; }
}
}
7 changes: 7 additions & 0 deletions Jiguang.JPush/Model/PushPayload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ public class PushPayload
/// <summary>
/// 推送平台。可以为 "android" / "ios" / "all"。
/// </summary>

[JsonProperty("callback", NullValueHandling = NullValueHandling.Ignore)]
public CallBack CallBack { get; set; }

[JsonProperty("notification_3rd", NullValueHandling = NullValueHandling.Ignore)]
public Notification3rd Notification3rd { get; set; }

[JsonProperty("platform", DefaultValueHandling = DefaultValueHandling.Include)]
public object Platform { get; set; } = "all";

Expand Down

0 comments on commit e51c825

Please sign in to comment.