Example #1
0
  /**
   * Try to find and delete the notification by the given notifId, and then send dismiss
   * session-less-signal
   *
   * @param notifId
   */
  public void dismiss(int notifId) {
    GenericLogger logger = nativePlatform.getNativeLogger();
    Transport transport = Transport.getInstance();

    logger.debug(
        TAG,
        "Dismiss method has been called, trying to find and delete the notification by its id: '"
            + notifId
            + "'");
    deleteNotificationById(notifId);

    // Sending dismiss signal
    try {
      UUID appId = transport.getAppId(transport.readAllProperties());
      DismissEmitter.send(notifId, appId);
    } catch (NotificationServiceException nse) {
      logger.error(
          TAG,
          "Unable to send the Dismiss signal for notifId: '"
              + notifId
              + "', Error: '"
              + nse.getMessage()
              + "'");
    }
  } // dismiss