更换阿里推送,消息页面,以及部分bug修复

This commit is contained in:
wbzhan
2019-06-15 17:44:25 +08:00
parent 1ff1ff84b1
commit 5a10dfa182
13 changed files with 97 additions and 98 deletions
@@ -297,35 +297,33 @@ extern BOOL launchedByNotification;
[self.dataSource addObject:oldMessageArray];
}
[self.tableView reloadData];
[self postReadMessageRequest];
}
} failure:^(NSError *err) {
[SVProgressHUD dismiss];
}];
}
//发送已读记录
-(void)postReadMessageRequestWithIndexPath:(NSIndexPath *)indexPath{
//进入消息列表,则设置所有消息为已读
-(void)postReadMessageRequest{
UserModel*userModel=[dataContorl getUserInfo];
PushmessageModel *model = [[self.dataSource objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
if([model.isRead integerValue]==1)//未读消息
{
NSDictionary *params = @{@"userId":userModel.userId,
@"pushId":model.pushId,
NSDictionary *params = @{@"userId":userModel.userId,
};
[AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:Push_Message_Readed params:params success:^(id response) {
[AFNOHeaderHttpTool requestWihtMethod:RequestTypePost url:Push_Message_Readed params:params success:^(id response) {
if (response) {
id resault=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
NSString *result = [resault objectForKey:RESPONSE_CODE];
if ([result integerValue]==kReqSuccess) {
//已读
}else{
}
}
} failure:^(NSError *err) {
}];
}
}];
}
//单独删除某一条消息
-(void)deleteSingleMessageWithIndex:(NSIndexPath *)indexPath{
@@ -517,8 +515,8 @@ extern BOOL launchedByNotification;
dispatch_async(dispatch_get_main_queue(), ^{
[self postReadMessageRequestWithIndexPath:indexPath];
//默认消息已读
// [self postReadMessageRequestWithIndexPath:indexPath];
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"温馨提示" message:@"确认删除该消息么" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"cancel Action");