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 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 Details

    • 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 unused
      priority - higher is higher, Log.INFO etc. recommended, probably unused
      title - for the popup, translated
      message - translated
      path - 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

      boolean update(int id, String title, String message, String path)
      Update the text of a notification if possible.
      Parameters:
      id - as received from notify()
      title - for the popup, translated
      message - translated
      path - in console starting with /, must be URL-escaped, or null
      Returns:
      success