我试图通过使用云函数(这是我的代码)将数据写到火药库
index.js
const functions = require('firebase-functions');
exports.addfield = functions.firestore
.document('userInfo/DsJcWyIwSDkf0BYTFBq9xfXkzGK7')
.onCreate((snap, context) => {
});空洞
Future<void> addfield() async {
HttpsCallable callable = FirebaseFunctions.instance.httpsCallable('addfield');
await callable.call();
print('Success');
}当我调用我的函数时
错误:flutter/lib/ui/ui_dart_state.cc(198)未处理的异常:firebase_found/not- NOT_FOUND
发布于 2022-08-20 04:37:27
onCreate不是可调用的函数,它是在创建文档时触发的。可调用函数的定义如下:
exports.addfield = functions.https.onCall((data, context) => {
// ...
});详情请参见从您的应用程序调用函数。
要创建文档,不需要函数,请参阅将数据添加到云修复中。
https://stackoverflow.com/questions/73418789
复制相似问题