Commit 3e59e066 by zhangyunjie

推送

parent bdb38571
// //
...@@ -53,6 +53,21 @@ ...@@ -53,6 +53,21 @@
} }
+(void)didReceiveRemoteNotification:(NSDictionary *)userInfo{ +(void)didReceiveRemoteNotification:(NSDictionary *)userInfo{
// {
// aps = {
// alert = {
// "action-loc-key" = "";
// body = "\U60a8\U6709\U4e00\U6761\U65b0\U7684\U6d88\U606f";
// "launch-image" = "";
// "loc-args" = "<null>";
// "loc-key" = "";
// title = "\U6d88\U606f\U901a\U77e5";
// "title-loc-args" = "<null>";
// "title-loc-key" = "";
// };
// };
// message = "{\"type\":1,\"body\":{\"session_id\":\"6e0f33004cb612a72341048b1eddbd3735e92dc4\",\"msg_id\":\"18fe84c6-25ea-41c7-9a70-1fe3e5c0b9ce\",\"version\":1,\"send_time\":\"2020-09-11 16:13:49\",\"msg_seq\":1599812029575,\"msg_from\":\"78f40cb49e0f54dd654de836c58f5202\",\"msg_to\":\"ce0819db8391f1e7258a71cc9e2c3235\",\"msg_scope\":1,\"msg_type\":1,\"msg\":{\"msg\":\"\U968f\U673a\U6570:9265\"}}}";
// }
OffcnIMPushModel *IMModel = [OffcnIMPushModel mj_ZYJobjectWithKeyValues:userInfo]; OffcnIMPushModel *IMModel = [OffcnIMPushModel mj_ZYJobjectWithKeyValues:userInfo];
...@@ -74,7 +89,7 @@ ...@@ -74,7 +89,7 @@
UILocalNotification *backgroudMsg = [[UILocalNotification alloc] init]; UILocalNotification *backgroudMsg = [[UILocalNotification alloc] init];
if (backgroudMsg) { if (backgroudMsg) {
backgroudMsg.timeZone = [NSTimeZone defaultTimeZone]; backgroudMsg.timeZone = [NSTimeZone defaultTimeZone];
backgroudMsg.alertBody = @"您收到一条新消息"; backgroudMsg.alertBody = @"您有一条新的消息";
backgroudMsg.applicationIconBadgeNumber = 1; backgroudMsg.applicationIconBadgeNumber = 1;
backgroudMsg.alertAction = @"查看"; backgroudMsg.alertAction = @"查看";
NSDictionary *infoDic = [NSDictionary dictionaryWithObject:@"name" forKey:@"key"]; NSDictionary *infoDic = [NSDictionary dictionaryWithObject:@"name" forKey:@"key"];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment