【问题标题】:Chrome Rich Notifications not showingChrome 丰富的通知未显示
【发布时间】:2014-03-03 20:41:05
【问题描述】:

好的,所以在我的 Chrome 扩展程序清单中,我已经允许通知,现在我正在使用 webkitNotifications,虽然我说的是丰富的通知并且更喜欢它们,所以我开始研究如何编写它们需要哪些参数,所以我在控制台中进行了测试,但它没有显示出来?

chrome.notifications.create('report',{
  type:'basic',
  title:'hello world',
  message:'Dance with me please',
  expandedMessage:'Hello thanks for using our app',
  priority:1,
  buttons:[{title:'Follow URL'},{title:'Remind me Later'}],
  isClickable:true
},function(){});

但我不确定这是否是我所需要的 webkitNotifications 需要一个 show() 函数来实际显示。有什么想法吗?

【问题讨论】:

    标签: javascript google-chrome google-chrome-extension


    【解决方案1】:

    iconUrlcreate 方法所必需的。 http://developer.chrome.com/extensions/notifications#type-NotificationOptions

    chrome.notifications.create('report',{
      type:'basic',
      title:'hello world',
      iconUrl: 'yourIconUrl',
      message:'Dance with me please',
      expandedMessage:'Hello thanks for using our app',
      priority:1,
      buttons:[{title:'Follow URL'},{title:'Remind me Later'}],
      isClickable:true
    },function(){});
    

    【讨论】:

      猜你喜欢
      • 2018-02-23
      • 2018-04-28
      • 1970-01-01
      • 1970-01-01
      • 2011-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-22
      相关资源
      最近更新 更多