小编Dal*_*uca的帖子

Chrome扩展程序通知仅显示一次

我的目标是在firebase中的值更改时使用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);
  });
});
Run Code Online (Sandbox Code Playgroud)

有解决方案吗

javascript google-chrome google-chrome-extension firebase

2
推荐指数
1
解决办法
959
查看次数