简体   繁体   English

如何在java中编写firebase云函数

[英]How to write firebase cloud functions in java

I am new in firebase .我是 firebase 的新手。 I am store data in firebase database using admin sdk(java code ).我使用 admin sdk(java 代码)将数据存储在 firebase 数据库中。 I have done this part successfully .我已经成功地完成了这部分。 Now i want write fire base cloud function on create of database entry and notification as现在我想在创建数据库条目和通知时编写基于 Firebase 的云函数

1. The function triggers on writes to the Realtime Database path where followers are stored.
2. The function composes a message to send via FCM.
3. FCM sends the notification message to the user's device.

As i have search more on internet , found only node.js code for that.由于我在互联网上进行了更多搜索,因此只找到了 node.js 代码。

https://firebase.google.com/docs/functions/get-started https://firebase.google.com/docs/functions/get-started

Is it possible to write firebase cloud function using admin sdk or java code.Please help me.是否可以使用管理 sdk 或 java 代码编写 firebase 云功能。请帮助我。

EDIT: May 30, 2020编辑:2020 年 5 月 30 日

There is now support for Java/JVM in Cloud Functions. Cloud Functions 现在支持 Java/JVM。 Please see the release blog and documentation for information.有关信息,请参阅发布博客文档

Original answer原答案

For Cloud Functions, there is currently no support for Java or any other languages or environments other than JavaScript in a node.js environment.对于 Cloud Functions,目前在 node.js 环境中不支持 Java 或除 JavaScript 之外的任何其他语言或环境。

GCP Cloud Functions now has a Java Runtime. GCP Cloud Functions 现在有一个 Java 运行时。

At this time it is currently in alpha, but I would expect it to release to Beta rather quickly.目前它目前处于 alpha 阶段,但我预计它会很快发布到 Beta 版。

There is no support for Java currently for cloud functions in Firebase. Firebase 中的云函数目前不支持 Java。 You can use JavaScript or TypeScript for this.为此,您可以使用 JavaScript 或 TypeScript。

Firebase Cloud Functions using TypeScript使用 TypeScript 的 Firebase 云函数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM