File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -619,10 +619,19 @@ - (void)onMessageReceived:(NSNotification *)notification
619
619
{
620
620
DLog (@" onMessageReceived." );
621
621
622
- NSMutableDictionary *notificationDict = [notification object ];
622
+ NSMutableDictionary *notificationDict = [NSMutableDictionary dictionary ];
623
623
624
+ CCPSysMessage *message = [notification object ];
625
+
626
+ notificationDict[@" title" ] = [[NSString alloc ] initWithData: message.title encoding: NSUTF8StringEncoding];
627
+ notificationDict[@" body" ] = [[NSString alloc ] initWithData: message.body encoding: NSUTF8StringEncoding];
624
628
// 取得通知自定义字段内容
625
- notificationDict[@" extras" ] = [notification userInfo ];
629
+ if (notification.userInfo ) {
630
+ notificationDict[@" extras" ] = notification.userInfo ;
631
+ } else {
632
+ notificationDict[@" extras" ] = @{};
633
+ }
634
+
626
635
627
636
// 类型 “notification” or "message"
628
637
notificationDict[@" type" ] = ALIYUN_PUSH_TYPE_MESSAGE;
You can’t perform that action at this time.
0 commit comments