我发送带有https://firebase.google.com/docs/cloud-messaging/send-message的推送通知:
var registrationToken = 'bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...';
var payload = {
notification: {
title: 'Urgent action needed!',
body: 'Urgent action is needed to prevent your account from being disabled!'
}
};
var options = {
priority: 'high',
timeToLive: 60 * 60 * 24
};
admin.messaging().sendToDevice(registrationToken, payload, options)
.then(function(response) {
console.log('Successfully sent message:', response);
})
.catch(function(error) {
console.log('Error sending message:', error);
});
我在手机(Android React Native App)上收到通知,但是在锁定屏幕上,我看到了接收通知的日期,而不是发送通知的日期。
例如,当手机恢复连接后收到通知时,就会发生这种情况。