SDKsiOS
获取未处理好友申请数
获取 iOS 好友申请的未处理数量。
获取指定时间点之后未处理的好友申请数量,常用于更新角标或未读红点提示:
参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
req | GetFriendApplicationUnhandledCountReq * | 查询未处理申请数的请求对象。 |
| 字段 | 类型 | 说明 |
|---|---|---|
time | NSInteger | 毫秒级时间戳,通常传入上次进入或浏览好友申请页面的时间。 |
GetFriendApplicationUnhandledCountReq *req = [GetFriendApplicationUnhandledCountReq new];
req.time = lastViewedAt;
[[OIMManager manager] getFriendApplicationUnhandledCount:req
onSuccess:^(NSInteger count) {
[requestStore setUnhandledCount:count];
}
onFailure:^(NSInteger code, NSString *message) {
NSLog(@"getFriendApplicationUnhandledCount failed: %ld %@", (long)code, message);
}];返回结果
成功回调 onSuccess 返回指定时间之后未处理的好友申请总数 count。查询本身不会触发申请事件;当有新的好友申请到达时,应通过获取收到的好友申请中说明的事件回调更新角标计数。
这个页面有帮助吗?