有点奇怪,反正我是在回答我的问题
我通过改变方法解决了问题
sendToCondition()
send()
.
var condition = "'FemaleAny' in topics || 'MaleAny' in topics";
var message = {
android: {
ttl: 30*1000, // 30sec in milliseconds
priority: 'normal',
notification: {
title: 'Someone want to chat',
body: 'Tap to join chat',
icon: 'stock_ticker_update',
color: '#2C5AE1',
tag: '4'
}
},
condition: condition
};
send.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);
});