我正在测试firebase云函数,我很好奇如何将数据从表单传递到云函数。我已经创建了一个接受几个字段的注册表单--我的计划是使用firebase创建一个auth帐户,并在创建auth帐户时运行一个云功能。此函数将在Firestore中创建一个用户文档。
下面的代码给出了我的前端设置的一个概念。
import React from "react"
import firebase from "firebase"
// create some config for firebase
const app = firebase.initializeApp(config
我有一个现有的谷歌云功能,我试图调用。我想向它传递一个Id,使用这个Id,云函数可以在后台运行它的操作。我是新的云功能,并将感谢帮助。当我调用函数时,我会得到错误“POST.500”,错误消息显示“内部”。下面是我用来调用云函数的代码,我在按钮中的onClick事件中声明了一个函数:
import { httpsCallable } from "firebase/functions";
import { functions } from "../../../firebase/firebase";
/* Below is how I call the clou
我正在使用Firebase云功能。在iOS设备上,im部署一个触发器以在Node.Js中运行云函数。在Xcode (这里是触发云函数的客户端函数)中,我正在传递字典data
func updateTermsOfServiceCloudCall(){
let data = [
"accountId": "acct_1Ew#######"
]
Functions.functions().httpsCallable("updateAccountWithTOA").call(data) { (result, e
我完全被困在这里了。我创建了一个pubsub调度器函数,如下所示。
const functions = require("firebase-functions");
exports.addTasksToQueueScheduler = functions.pubsub
.schedule('every 5 minutes')
.onRun((context) => {
console.log('This will be run every five minutes!');
return null;
})
当我试图使用firebase云函数模拟器在本地调用我的可调用函数时,我得到了以下CORS错误:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://us-central1-xxxx-xxxxx.cloudfunctions.net/getSignedUrls. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 302.
这是我的云功能:
/函数/i