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
Modifier and TypeMethodDescriptionbooleancancel(int id) Cancel a notification if possible.intSend a (possibly delayed) notification to the user.booleanUpdate the text of a notification if possible.
-
Method Details
-
notify
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
-
update
Update the text of a notification if possible.- Parameters:
id- as received from notify()title- for the popup, translatedmessage- translatedpath- in console starting with /, must be URL-escaped, or null- Returns:
- success
-