Package net.i2p.app
Interface NotificationService
-
- All Known Implementing Classes:
ExternalMain
,Main
public interface NotificationService
A service to send messages to users. This service is currently provided by desktopgui (when supported and enabled). Other applications may support this interface in the future. Example usage:ClientAppManager cmgr = _context.clientAppManager(); if (cmgr != null) { NotificationService ns = (NotificationService) cmgr.getRegisteredApp("desktopgui"); if (ns != null) ns.notify("foo", null, Log.INFO, _t("foo"), _t("message"), "/foo/bar"); }
- Since:
- 0.9.53
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
cancel(int id)
Cancel a notification if possible.int
notify(String source, String category, int priority, String title, String message, String path)
Send a (possibly delayed) notification to the user.boolean
update(int id, String title, String message, String path)
Update the text of a notification if possible.
-
-
-
Method Detail
-
notify
int notify(String source, String category, int priority, String title, String message, String path)
Send a (possibly delayed) notification to the user.- Parameters:
source
- e.g. "i2psnark"category
- may be null, probably unusedpriority
- higher is higher, Log.INFO etc. recommended, probably unusedtitle
- for the popup, translatedmessage
- translatedpath
- in console for more information, starting with /, must be URL-escaped, or null- Returns:
- an ID to use with cancel() or update(), or -1 on failure
-
cancel
boolean cancel(int id)
Cancel a notification if possible.- Parameters:
id
- as received from notify()- Returns:
- success
-
-