求救啊....前段时间还没有这个问题的
用AVInstallation添加了一个channels, 然后用saveInBackgroundWithBlock保存, 回调的succeeded是YES, 但是leancloud存储_Installation表是没有变化的, 请问是什么原因, 下面我贴出一些代码和log:

我保存的值是in, 用户名是test9
代码:

[BZChatKitManager invokeThisMethodAfterLoginSuccessWithClientId:userName success:^{
        [USER_DEFAULT setBool:NO forKey:NEW_LOGIN];
        NSLog(@"AVOSCloud 登陆成功");
        AVInstallation * installation = [AVInstallation currentInstallation];
        NSLog(@"installation.channels1 == %@",installation.channels);
        [installation addUniqueObject:language forKey:@"channels"];
        NSLog(@"installation.channels2 == %@",installation.channels);
        [installation saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
            if (succeeded) {
                NSLog(@"用户信息保存成功");
                NSLog(@"installation.channels3 == %@",installation.channels);
            }else{
                NSLog(@"error == %@",error);
            }
        }];
    } failed:^(NSError *error) {
        NSLog(@"AVOSCloud 登陆失败%@",error);
    }];

打印的log:

AVOSCloud 登陆成功
installation.channels1 == (
    test9
)
installation.channels2 == (
    test9,
    in
)

[DEBUG] __59-[AVPaasClient performRequest:saveResult:block:retryTimes:]_block_invoke [Line 577] 

------ BEGIN LeanCloud REST Response ------
path: /1.1/batch/save
cost: 0.098s
response: {
    IKgtyAQypmCuneo6h0wsjBaCiX2NKKac =     {
        createdAt = "2016-12-01T09:37:00.590Z";
        objectId = IKgtyAQypmCuneo6h0wsjBaCiX2NKKac;
        updatedAt = "2016-12-01T09:44:35.350Z";
    };
}
------ END --------------------------------

[INFO] -[AVIMWebSocketWrapper webSocket:didReceiveMessage:] [Line 764] 

------ BEGIN LeanCloud IM In Command ------
content: <AVIMGenericCommand 0x1701da400>: {
    cmd: report
    op: uploaded
    appId: "EcchTDMqE3DJovrA0GDcanCV-gzGzoHsz"
    peerId: "test9"
    reportMessage {
    }
}
------ END --------------------------------

[INFO] -[AVObject saveWithOption:eventually:verifyBefore:error:] [Line 700] 

Object not changed, ignore save request.

用户信息保存成功

installation.channels3 == (
    test9,
    in
)

请问明明改变了 为什么还会出现

Object not changed, ignore save request.

这句信息呢
后台的存储_Installation没有保存in 只是登录的时候SDK自己帮保存了一个用户名, 试过卸载app重新安装也不行

你好,我正在查看你的问题,请稍等。

好的 谢谢 请问查到问题所在了吗

请把 [installation saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error)]; 这个 request 贴出来。

日志里只有 response
------ BEGIN LeanCloud REST Response ------

登录成功后 完整的日志

2016-12-02 16:12:32.335839 YMTranslateCloudService[6745:2669963] AVOSCloud 登陆成功

<AppDelegate.m : 177> __33+[AppDelegate showMainController]_block_invoke
2016-12-02 16:12:32.336059 YMTranslateCloudService[6745:2669963] installation.channels1 == (
    test9
)

<AppDelegate.m : 180> __33+[AppDelegate showMainController]_block_invoke
2016-12-02 16:12:32.336269 YMTranslateCloudService[6745:2669963] installation.channels2 == (
    test9,
    in
)

2016-12-02 16:12:32.336946 YMTranslateCloudService[6745:2670002] [DEBUG] -[AVPaasClient performRequest:success:failure:] [Line 654] 

------ BEGIN LeanCloud REST Request -------
path: /1.1/batch/save
curl: curl -i -k -X POST -d '{"requests":[{"path":"\/1.1\/installations","method":"POST","body":{"__type":"Object","timeZone":"Asia\/Shanghai","badge":0,"channels":["test9"],"deviceType":"ios","apnsTopic":"com.emindsoft.interpreter","objectId":"lgR7haNDD0TBgBGDDtiJp851pl3eyOYG","__internalId":"lgR7haNDD0TBgBGDDtiJp851pl3eyOYG","deviceToken":"0fac8cb4bc7ff889e163edd078bd482d95ebbf233f8a2122f500b6dc3e4f135f","deviceProfile":"interpreter_push_dev"}},{"path":"\/1.1\/installations","method":"POST","body":{"deviceToken":"0fac8cb4bc7ff889e163edd078bd482d95ebbf233f8a2122f500b6dc3e4f135f","channels":{"objects":["test9"],"__op":"AddUnique"},"__internalId":"lgR7haNDD0TBgBGDDtiJp851pl3eyOYG","objectId":"lgR7haNDD0TBgBGDDtiJp851pl3eyOYG","deviceType":"ios"}}]}' --compressed -H 'Accept: application/json' -H 'Content-Type: application/json; charset=utf-8' -H 'X-LC-Sign: 997add48d9811cd7399e7b6ef544c6d9,1480666352333' -H 'User-Agent: AVOS Cloud iOS-v3.6.1 S
2016-12-02 16:12:32.460396 YMTranslateCloudService[6745:2670070] [DEBUG] __59-[AVPaasClient performRequest:saveResult:block:retryTimes:]_block_invoke [Line 577] 

------ BEGIN LeanCloud REST Response ------
path: /1.1/batch/save
cost: 0.115s
response: {
    lgR7haNDD0TBgBGDDtiJp851pl3eyOYG =     {
        createdAt = "2016-12-02T08:06:33.024Z";
        objectId = lgR7haNDD0TBgBGDDtiJp851pl3eyOYG;
        updatedAt = "2016-12-02T08:12:32.419Z";
    };
}
------ END --------------------------------
2016-12-02 16:12:32.478136 YMTranslateCloudService[6745:2669963] [INFO] -[AVIMWebSocketWrapper webSocket:didReceiveMessage:] [Line 764] 

------ BEGIN LeanCloud IM In Command ------
content: <AVIMGenericCommand 0x1701d4910>: {
    cmd: report
    op: uploaded
    appId: "EcchTDMqE3DJovrA0GDcanCV-gzGzoHsz"
    peerId: "test9"
    reportMessage {
    }
}
------ END --------------------------------
2016-12-02 16:12:32.541714 YMTranslateCloudService[6745:2670097] [INFO] -[AVObject saveWithOption:eventually:verifyBefore:error:] [Line 700] Object not changed, ignore save request.
<AppDelegate.m : 183> __33+[AppDelegate showMainController]_block_invoke_2
2016-12-02 16:12:32.541991 YMTranslateCloudService[6745:2669963] 用户信息保存成功

<AppDelegate.m : 184> __33+[AppDelegate showMainController]_block_invoke_2
2016-12-02 16:12:32.542108 YMTranslateCloudService[6745:2669963] installation.channels3 == (
    test9,
    in
)

登录的代码 和上面对比 多了一行 [installation addUniqueObject:userName forKey:@"channels"];

[BZChatKitManager invokeThisMethodAfterLoginSuccessWithClientId:userName success:^{
        [USER_DEFAULT setBool:NO forKey:NEW_LOGIN];
        NSLog(@"AVOSCloud 登陆成功");
        AVInstallation * installation = [AVInstallation currentInstallation];
        NSLog(@"installation.channels1 == %@",installation.channels);
        [installation addUniqueObject:userName forKey:@"channels"];
        [installation addUniqueObject:language forKey:@"channels"];
        NSLog(@"installation.channels2 == %@",installation.channels);
        [installation saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
            if (succeeded) {
                NSLog(@"用户信息保存成功");
                NSLog(@"installation.channels3 == %@",installation.channels);
            }else{
                NSLog(@"error == %@",error);
            }
        }];
    } failed:^(NSError *error) {
        NSLog(@"AVOSCloud 登陆失败%@",error);
    }];

Object not changed, ignore save request. 出现了这一句 我怀疑我登录后的saveInBackgroundWithBlock并没有执行 打印的日志应该只是你们sdk保存clientid的日志

请确认 addUnique 方法提供的 channel 值是什么。从保存的请求日志来看,你提供的是 "test9",不是 "in":

{
  "requests": [
    {
      "path": "/1.1/installations",
      "method": "POST",
      "body": {
        "__type": "Object",
        "timeZone": "Asia/Shanghai",
        "badge": 0,
        "channels": [
          "test9"
        ],
        "deviceType": "ios",
        "apnsTopic": "com.emindsoft.interpreter",
        "objectId": "lgR7haNDD0TBgBGDDtiJp851pl3eyOYG",
        "__internalId": "lgR7haNDD0TBgBGDDtiJp851pl3eyOYG",
        "deviceToken": "0fac8cb4bc7ff889e163edd078bd482d95ebbf233f8a2122f500b6dc3e4f135f",
        "deviceProfile": "interpreter_push_dev"
      }
    },
    {
      "path": "/1.1/installations",
      "method": "POST",
      "body": {
        "deviceToken": "0fac8cb4bc7ff889e163edd078bd482d95ebbf233f8a2122f500b6dc3e4f135f",
        "channels": {
          "objects": [
            "test9"
          ],
          "__op": "AddUnique"
        },
        "__internalId": "lgR7haNDD0TBgBGDDtiJp851pl3eyOYG",
        "objectId": "lgR7haNDD0TBgBGDDtiJp851pl3eyOYG",
        "deviceType": "ios"
      }
    }
  ]
}

是啊 你看看我上面的installation.channels2 installation.channels3输出 都是有in的 我的saveInBackgroundWithBlock根本没被执行 执行的是sdk自己的保存self.clientId的代码 时间上是差不多的

有可能是 SDK 在保存 channels 时,与您的保存请求有冲突。请确保您的保存请求在 SDK 保存完成后再执行,比如放到 client 登录成功的回调中执行。保证保存的执行顺序。另外,请提供一个能复现该问题的 demo。

我就是放在登录成功的回调里执行的 只是你们SDK登录的保存用的也是异步保存 这里就存在问题了,,, 我弄一个demo看看吧 请稍等

链接: https://pan.baidu.com/s/1eSJry1s 密码: ne6n
我用你们的ChatKit-OC-master 改了一下 项目是ChatKit-OC 里面的appid什么的也是你们原来自带的 我试过了 可以重现 如果不可以 麻烦请多试几次登录注销 谢谢了
步骤是 登录 然后注销
登录成功后我加了test1 和test2 两个频道
麻烦啦

已下载,正在研究问题产生的原因。

hi 请问怎么样了呢 是什么原因呢 有解决方案吗

请问有人吗 O__O "…

你好,我们没有通过您提供的 demo 复现。不过发现 SDK 目前对 installation 的保存策略的确存在这个问题,我们正在想办法解决。有进展会第一时间在此回复。

好的 flushed

好的 我现在去试试看 谢谢了