Commit 0b96ac09 by zhangyunjie

待处理

parent b1724dd9
......@@ -127,6 +127,7 @@
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
NSLog(@"接收到远程推送通知 ---- %@", userInfo);
[self didReceiveRemoteNotification:userInfo];
/*
"name" : "YFPushTest",
......
//
//
......@@ -17,6 +17,9 @@ NS_ASSUME_NONNULL_BEGIN
//解析deviceToken
-(NSString *)hexStringForData:(NSData *)data;
//收到通知
-(void)didReceiveRemoteNotification:(NSDictionary *)userInfo;
@end
NS_ASSUME_NONNULL_END
......
//
//
......@@ -7,6 +7,10 @@
//
#import "AppDelegate+OffcnIMPush.h"
#import "OffcnIMModel.h"
#import "ZYJMJExtension.h"
#import "DataSafe.h"
#import "OffcnIMZYJFMDBHandler.h"
@implementation AppDelegate (OffcnIMPush)
......@@ -40,4 +44,18 @@
}
return hexString;
}
-(void)didReceiveRemoteNotification:(NSDictionary *)userInfo{
NSString *revStr = @"";
OffcnIMModel *IMModel = [OffcnIMModel mj_ZYJobjectWithKeyValues:revStr];
//存数据库
OffcnIMBodyModel *body = IMModel.body;
body.isSentSuccess = 1;
body.bymyself = 0;
body.isRead = 0;
[[OffcnIMZYJFMDBHandler sharedInstance] insertChatInfoToFMDBWithModel:body];
[[OffcnIMZYJFMDBHandler sharedInstance] chatlistCacheInfo:body callback:nil];
}
@end
//
//
......@@ -191,7 +191,7 @@
NSString *url = [NSString stringWithFormat:@"%@?accid=%@",getRecentSessionsURL,accid];
[OffcnBaseNetworking getFromURL:url params:nil finished:^(BaseResponse *baseResponse) {
if (baseResponse.isSuccess) {
//接口缺少返回msg_from,然后解析存数据库
OffcnIMRecentMsgModel *recentMsgModel = [OffcnIMRecentMsgModel mj_ZYJobjectWithKeyValues:baseResponse.responseObject];
for (int i=0; i<recentMsgModel.sessions.count; i++) {
......
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