Tag: firebase

有没有办法通过我的Node.js服务器发送带有Firebase Admin SDK的validation邮件?

有没有办法从我的服务器发送电子邮件validation电子邮件? 这是如何在客户端上完成的: authData.sendEmailVerification().then(function() { 有没有办法在服务器上做到这一点?

Firebase提供了一个“0”而不是实际的variables内容

我正在更新一个名为消息线程的字段下的数据库中的值。 在那个线程下,我想存储所有用户的密钥,并且在那个密钥中我想要他们的图片。 从这里我已经构build了一个包含以下内容的循环: firebase.database().ref('users/' + userUID + '/messageThreads/' + newThreadID).update({ "date": currentDate.getTime(), "lastMessage": "", "read": false, "isGroup": true }); console.log(groupUID); firebase.database().ref('users/' + userUID + '/messageThreads/' + newThreadID + "/" + "userUID").update({ [groupUID]: [groupPic] }); 出于某种原因,在数据库而不是groupUID的值下,它将置零。 有什么build议么?

有没有办法将不同的徽章计数发送给同一主题的不同用户?

我有我的Node.js项目,我正在向IOS用户发送通知数量的FCM集成,我需要pipe理通知计数,即徽章计数,这将是不同的设备,但我发送通知给一个特定的主题,这些设备已订阅。 我的有效载荷是: var payload = { notification: { title: "Title…", body: "Notification Body…", sound: "customeSound.caf", badge : "?" }, data: { testData: "custom data" } }, topic = "topicName"; admin.messaging().sendToTopic(topic, payload) .then(function (response) { // See the MessagingTopicResponse reference documentation for the // contents of response. console.log("Successfully sent message:", response); }) .catch(function (error) { console.log("Error […]

FCM错误结果 – 将错误提交给令牌

当通过fcm (通过nodejs firebase admin sdk)发送推送消息时,得到这个错误结构: { "results": [ { "error": { "code": "messaging/invalid-registration-token", "message": "Invalid registration token provided. Make sure it matches the registration token the client app receives from registering with FCM." } } ], "canonicalRegistrationTokenCount": 0, "failureCount": 1, "successCount": 0, "multicastId": SOME_ID } 结果的索引是否与发送给firebase的令牌数组的索引相关?

Firebase函数返回并承诺不会退出该函数

我仍然是Firebase世界的初学者,我一直在试图弄清楚下面的代码是什么问题,但是我没有任何可能的办法。 代码应该从数据库中的用户configuration文件中检索uid ,然后使用它来更新authenticationconfiguration文件,然后在authenticationconfiguration文件更新成功时再次更新数据库configuration文件。 在index.js我定义了一个导出的函数来处理来自HTML表单的POST参数。 下面的代码定义了另一个模块文件中的处理函数: exports.auUpdateUserByEmail = (req, res) => { // This handler function will retrieve the POSTed params of user profile // and will attempt to update the existing user authentication as well as // the database profiles. // // This function accepts the following params: // 1. User email // 2. Phone […]

Firebase云端function/ Firestore

我试图运行一个firebase云计算function来为Angular 5项目创build一个primefaces(批量)更新,无论何时创build一个新客户。 我一直得到这个错误,不能解决问题是什么: console.error 错误:无法将types([对象未定义])编码为Function.encodeValue上的Firestore值(/user_code/node_modules/firebase-admin/node_modules/@google-cloud/firestore/src/document.js:658:11) 云端函数(index.js) const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(functions.config().firebase); const stripe = require('stripe')(functions.config().stripe.testkey); // 1. Create Stripe User on sign up exports.createStripeCustomer = functions.auth.user().onCreate(event => { // user auth data const user = event.data; // register Stripe user return stripe.customers.create({ email: user.email }) .then(customer => { const db = […]

Firebase 3 – 无法从数据库检索数据(Web)

我正在使用第一次使用Firebase 3 (最新版本)的Firebase 3应用程序,但是在retrieving data页面上的retrieving data时遇到麻烦。 我已经从Heroku创build了一个NodeJStesting应用程序,然后我试图检索我的Firebase realtime database保存的JSON格式的数据(ref的path到我的数据数组)。 我按照文档 ,但没有结果。 这是我的代码: <script src="https://www.gstatic.com/firebasejs/live/3.0/firebase.js"></script> <script> // Initialize Firebase var config = { apiKey: "*******", authDomain: "*******", databaseURL: "*******", storageBucket: "*******", }; firebase.initializeApp(config); firebase.database().ref('my/path/to/data').on('value', function(snapshot) { console.log('kk'); //no log in the console }); </script> 控制台中没有错误,但也没有结果。 这似乎很简单,但我不知道我失踪。

Firebase createUserWithEmailAndPassword方法在node.js中未定义

启动时出现问题.. 我初始化了我的Firebase应用程序。 但auth()不起作用 var auth = firebase.auth(); console.log(auth.createUserWithEmailAndPassword) createUserWithEmailAndPassword返回undefined。 它也给function错误 var email = "mail@mail.com" var password = 123 var auth = firebase.auth(); auth.createUserWithEmailAndPassword(email, password).then(function(result) { console.log(result) }).catch(function(error) { console.log(error) }); 错误: TypeError:auth.createUserWithEmailAndPassword不是一个函数 问题是什么?

当我的Node.js应用程序处于脱机状态时,是否应将Firebase数据库设置为脱机?

我正在开发基于Node.js (Electron)的桌面应用程序,该应用程序从用户计算机收集数据,并通过Firebase Node.js模块将其发送到Firebase Realtime database 。 当用户离线时,我想继续收集数据,并在发生连接时将其发送到Firebase ,但是我感到有点困惑。 显然,根据文档Firebase在会话处于活动状态时(这意味着我的应用程序仍在运行而未closures)会自动执行此操作(在本地执行put和set并在线发送数据),这是正确的吗? 在文档中有两个方法firebase.database().goOffline(); 和firebase.database().goOnline(); ,我应该不断观看互联网连接,并设置Firabse离线和在我的代码在线? 谢谢

Firebase函数signInWithCustomToken与Node.js一起未定义

所以我创build了一个自定义标记 const token = authRef.createCustomToken(options.userId, { app: appRootName, debug: !!options.debug }); 然后尝试签入 return authRef.signInWithCustomToken(token).then((user) => { return user; }); 自定义创build令牌成功,但signInWithCustomToken吐出这个错误。 TypeError: authRef.signInWithCustomToken is not a function 这是针对nodejs的Firebase 3,并已设置服务帐户。 该应用程序已正确初始化(或者代币生成首先不起作用),这里有什么问题?