javascript - 更改谷歌帐户后反应本机firestore不上传数据
问题描述
我使用 firestore 和 react-native 制作了一个应用程序,它运行良好。我最近决定更改创建应用程序时使用的 google 帐户,并使用新凭据更新了 google-services.json,但是现在它停止工作了。
firestore().collection(''+now.getFullYear()+''+(now.getMonth()+1))
.doc(''+now.getDate()+''+now.getHours()+''+now.getMinutes()+''+now.getSeconds()).set(
{
time: Date(),
point: blob
}
).then(()=>{
console.log('Uploaded data')
status('Uploaded')
})
这是我添加数据的代码,.then 函数运行并返回上传的数据,但是在 firebase 控制台上没有添加数据。
我该如何进行调试并找到确切的问题?或者有人可以指出我是否在某处犯了错误,谢谢
解决方案
可以尝试添加
.catch(error => {
console.log(error)
})
所以它会是
firestore().collection(''+now.getFullYear()+''+(now.getMonth()+1))
.doc(''+now.getDate()+''+now.getHours()+''+now.getMinutes()+''+now.getSeconds()).set(
{
time: Date(),
point: blob
}
).then(()=>{
console.log('Uploaded data')
status('Uploaded')
}).catch(error => {
console.log(error)
})
推荐阅读
- sql - 如何选择一个表中共存的ID(多对多)
- java - 我想让 2d 随机数数组有错误:不兼容的类型:int 无法转换为 int[]
- c# - 并发问题不知道如何解决
- ruby-on-rails - Rails 问题:@blogs.count 显示在本地但不在 Heroku 上
- c# - 为什么要使用新的 Vector3?有什么区别?
- python - Python 更改列表中的值会无意中更改它们
- javascript - 我需要帮助来获取多维数组的总和
- java - 如何使用 javac -h?
- angular - Angular - 使用基本身份验证获取数据
- android - 如何在android kotlin的edittext中读取文本