jpush / jpush-api-csharp-client

JPush's officially supported C# client library for accessing JPush APIs. 极光推送官方支持的 C# 版本服务器端 SDK。
https://docs.jiguang.cn
MIT License
132 stars 82 forks source link

cn.jpush.api.push.notification 通知,extras需要添加复杂json数据 #6

Closed BlueColorDemon closed 8 years ago

BlueColorDemon commented 8 years ago

由于业务需要,通知,extras需要添加复杂json数据,现添加如下方法 希望,作者,添加如下功能到新版sdk当中 cn.jpush.api.push.notification 命名空间下 AndroidNotification.cs 添加以下方法 public AndroidNotification AddExtra(string key, object value) { if (extras == null) { extras = new Dictionary<string, object>(); } if (value != null) { extras.Add(key, value); } return this; } IosNotification.cs 添加以下方法 public IosNotification AddExtra(string key, object value) { if (extras == null) { extras = new Dictionary<string, object>(); } if (value != null) { extras.Add(key, value); } return this; } WinphoneNotification.cs 添加以下方法 public WinphoneNotification AddExtra(string key, object value) { if (extras == null) { extras = new Dictionary<string, object>(); } if (value != null) { extras.Add(key, value); }

        return this;
fendouai commented 8 years ago

你好,具体是什么问题呢?

BlueColorDemon commented 8 years ago

{ "extras": { "PushCode": 8, "PushDescription": "回复", "EventDetailId": "383", "EventOption": { "SenderTypeId": "2", "SenderUserName": "153101" }, "FunctionCode": 115, "FunctionDescription": "消息" } } 我想实现,这样一个json对象,现有sdk,无法实现, 所以,我手动添加了以上方法以便达到我的需求