发送到各个设备,在本地运行功能时发出错误

时间:2017-10-04 08:37:59

标签: firebase firebase-cloud-messaging

我有一个sends a message to devices

的Firebase云功能
admin.messaging().sendToDevice(registrationTokens, payload, options)
    .then(function() {
    })
    .catch(function(error) {
        console.log(error.message);
    });

在部署函数时,这可以正常运行,但是当它在本地运行时(firebase serve --only functions),它会出现此错误:

  

尝试向FCM服务器进行身份验证时发生错误。使   确保用于验证此SDK的凭据具有正确的凭据   权限。

为什么会发生这种情况?

0 个答案:

没有答案