第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

TypeError: admin.messaging.sendToDevice is not a

TypeError: admin.messaging.sendToDevice is not a

米琪卡哇伊 2022-06-09 17:01:17
在使用以下功能時,我正在向設備發(fā)送設備通知,我在用于消息傳遞的 firebase 云功能中收到此錯誤TypeError:admin.messaging.sendToDevice 不是函數(shù)return admin.messaging.sendToDevice(to_token_id,payload).then(result=>{            console.log("Notification Sent Successful");            return null;        });上述方法是否已棄用?如果是這樣,那么新的是什么?上面的firebase cloud函數(shù)是用javascript寫的。
查看完整描述

1 回答

?
搖曳的薔薇

TA貢獻1793條經(jīng)驗 獲得超6個贊

sendToDevice,你需要使用方法send():


// The topic name can be optionally prefixed with "/topics/".

var topic = 'highScores';


var message = {

  data: {

    score: '850',

    time: '2:45'

  },

  topic: topic

};


// Send a message to devices subscribed to the provided topic.

admin.messaging().send(message)

  .then((response) => {

    // Response is a message ID string.

    console.log('Successfully sent message:', response);

  })

  .catch((error) => {

    console.log('Error sending message:', error);

  });

https://firebase.google.com/docs/cloud-messaging/android/send-multiple#build_send_requests


查看完整回答
反對 回復 2022-06-09
  • 1 回答
  • 0 關(guān)注
  • 121 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號