我的目標是在Firebase中的值發生更改時使用Chrome擴展程序創建通知。
使用下面的代碼,我在第一次更改該值時收到通知,但不是以下時間。Chrome擴展程序通知僅顯示一次
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);
});
});
任何解決方案?