大家好,我在 React Native 的 iOS 应用上使用 leancloud-storage
和 leancloud-installation
进行通知设备注册时,遭遇了灵异现象。在调用 installation.save()
函数后,程序成功返回了 LeanCloud 服务端响应结果,但在后台 - 数据管理 - 数据 - _Installation 中,却找不到相应保存的记录,整个表的记录数为 0,让我感觉来到了成都。
相关代码如下:
AV.initialize(config.AV.appId, config.AV.appKey);
const Installation = AVInstallation(AV);
const info = {
deviceType: token.os,
deviceToken: token.token,
};
const installation = await Installation.getCurrent();
const result = await installation.save(info);
console.log(result);
控制台显示程序输出:
[22:07:38] Object {
[22:07:38] "createdAt": "2019-01-30T01:18:02.317Z",
[22:07:38] "deviceToken": "4c70...",
[22:07:38] "deviceType": "ios",
[22:07:38] "objectId": "kfKsrPqm3T0Ju9nNDz3Cllwl0b1ol2LE",
[22:07:38] "timeZone": "America/New_York",
[22:07:38] "updatedAt": "2019-01-30T01:18:02.317Z",
[22:07:38] }
iOS 设备的 deviceToken
是通过 react-native-push-notification
获取的,应该没问题。
App ID: RdQfc8SI7K8GpW72RLV8C1NJ-gzGzoHsz
相关版本号:
{
"react-native-push-notification": "^3.1.2",
"leancloud-installation": "2.0.1",
"leancloud-storage": "3.11.1"
}
拜托论坛各位大神帮忙看下哪里出了什么问题。我不想遭遇灵异现象,也不想去成都。提前祝大家新春快乐了。
-
创建时间
19年1月30日
-
最后回复
19年1月31日
-
8
回复
-
1.5K
浏览
-
3
用户
-
1
赞
-
1
链接