[AVPush unsubscribeFromChannelInBackground:userId block:block];
    [[AVUser currentUser] removeObjectForKey:kAVIMInstallationKeyUser];
    [[AVUser currentUser] saveInBackground];

[[AVIMClient defaultClient] closeWithCallback:callback];
[AVUser logout];
ios发现登出后调用了此函数后,但是还能收到推送,是不是这几个函数有的调用失败导致的,还有推送一个消息下来,未读数字有时候很大,100多,但是只有1个未读消息,此类问题该如何解释

AVInstallation *currentInstallation = [AVInstallation currentInstallation];
if (currentInstallation.badge != [UIApplication sharedApplication].applicationIconBadgeNumber) {
    [currentInstallation setBadge:[UIApplication sharedApplication].applicationIconBadgeNumber];
    [currentInstallation saveEventually: ^(BOOL succeeded, NSError *error) {
        DLog(@"%@", error ? error : @"succeed");
    }];
} else {

// DLog(@"badge not changed");
} 这个函数leanchat demo里面有调用,有必要吗,如果当前手机断网,执行closeWithCallback 能成功吗

1、这段代码是清除 badge 用的,如果不调用数字就会一直涨。
2、断网情况下,close 不会成功。

如果断网close不成功,我门项目不完全依赖于你们,即使断网,我门项目也可以登出,现在发现这边推送有点乱,登出失败,就不应该收到推送了,但是还可以推送,你们sdk应该处理一下

close 时需要告诉服务器这个用户已经登出了,不要再给他发离线消息了。
在断网状态下这个功能是做不到的,所以无法 close 成功。

离线消息是你们服务器发的啊,现在的bug就是用户A登出了,但是B给A发送消息,A还能收到推送

确认 closeWithCallback 成功了吗?断网情况下无法 close 成功,服务器会继续推送离线消息。

openWithClientId:(NSString *)clientId
tag:@"mobile"
callback:(AVIMBooleanResultBlock)callback
tag 我设置一个值没用啊,报登录失败,场景是这样的,A,B 两个设备同时登录同一个账号1,同时进去后台,账号2 发送消息,A,B都能收到推送消息,看了你们文档,可以设置一个值,tag 但是设置了,报open failed

AVIMClient *currentClient = [[AVIMClient alloc] initWithClientId:@"Tom" tag:@"Mobile"];
[currentClient openWithCallback:^(BOOL succeeded, NSError *error) {
if (succeeded) {
// 与云端建立连接成功
}
}]; 这个Mobile 是自定义的嘛