Saturday, 15 January 2011

javascript - Chrome Extension Notifications Not Always Created - Reuse? -



javascript - Chrome Extension Notifications Not Always Created - Reuse? -

let's want show same notification each time happens. that's use:

chrome.notifications.create(id, { type:"basic", title:"title", message:"my message", iconurl: "icon.png", }, notificationresult);

but notification doesn't appear.

is id thing ? need reuse created notification ? can not create new notification same id ?

i tried var notification = chrome.notifications.create(id .... ) , notification.show() in case created 1 same id didn't solve it.

so - need recreate existing notification each time want show same 1 (which doesn't work me), or there different way? how create sure pops every time?

the id in create function reusing. ids must unique. if utilize create id of existing notification, behaves update.

if notification exists, may no longer shown visible in message center. in case, notification updated - not shown again.

the api docs specify can pass empty string notification unique new id. if need it, passed callback.

but if want reuse id (ensuring notification unique), can utilize priority trick create show again.

javascript google-chrome google-chrome-extension

No comments:

Post a Comment