我的目标是创建一个Chrome扩展程序,在Firebase的值发生变化时发送通知。
使用以下代码,第一次更改值时我会收到通知,但后续更改却没有收到。
f.on('child_changed', function (snapshot) {
ignoreInitialData = false;
var options = {
type: 'basic',
iconUrl: '../../icons/green.png',
title: "Availability notifier",
message: snapshot.val(),
contextMessage: "",
eventTime: Date.now(),
isClickable: false,
};
chrome.notifications.create("child_changed", options, function (notificationID) {
console.error(chrome.runtime.lastError);
});
});
有什么解决方案吗?