现在的问题,
注册用户推送权限后,再保存 installations时,后台的_installation表为空。

AVInstallation *currentInstallation = [AVInstallation currentInstallation];
[currentInstallation setDeviceTokenFromData:deviceToken];
[currentInstallation saveInBackground];

打印出来的deviceToken 有值,但是 installation id 为空。

你好,iOS 推送正是用的 deviceToken 作为设备的唯一标识符,而 installationId 是 Android 设备的唯一标识符。反过来,您使用 Android 推送的时候,deviceToken 也会为空。

请先阅读下,我们推送的原理概览: https://leancloud.cn/docs/push_guide.html#基本概念7

没有存入哪些字段?请说明一下。

我按照文档首先获取用户推送权限,然后再保存 installation 。
但是后台控制器的_Installation 表未空的。没有将设备信息保存。
我之前以为是应用appkey 按到 appid 的问题。
我就测试随意创建一个 avobject test 对象。
这个test对象在控制台保存了。但是_installation表为空.

请使用 saveInBackgroundWithBlock 方法,看下 block 里,是否有报错。查看一下 NSError 具体是什么。

Error Domain=AVOS Cloud Error Domain Code=401 "Unauthorized." UserInfo=0x170e6fd40 {error=Unauthorized., NSLocalizedDescription=Unauthorized., code=401}

这个错误。