Closed BlueColorDemon closed 8 years ago
你好,具体是什么问题呢?
{ "extras": { "PushCode": 8, "PushDescription": "回复", "EventDetailId": "383", "EventOption": { "SenderTypeId": "2", "SenderUserName": "153101" }, "FunctionCode": 115, "FunctionDescription": "消息" } } 我想实现,这样一个json对象,现有sdk,无法实现, 所以,我手动添加了以上方法以便达到我的需求
由于业务需要,通知,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); }