/**
   * Called when we need to send a signal
   *
   * @param version The version of the message signature
   * @param msgId notification Id the id of the sent signal
   * @param messageType The message type of the sent message
   * @param deviceId Device id
   * @param deviceName Device name
   * @param appId App id
   * @param appName App name
   * @param attributes All the notification metadata
   * @param customAttributes The customAttributes
   * @param text Array of texts to be sent
   * @param ttl Notification message TTL
   * @throws NotificationServiceException
   */
  public void sendNotification(
      int version,
      int msgId,
      NotificationMessageType messageType,
      String deviceId,
      String deviceName,
      byte[] appId,
      String appName,
      Map<Integer, Variant> attributes,
      Map<String, String> customAttributes,
      TransportNotificationText[] text,
      int ttl)
      throws NotificationServiceException {

    GenericLogger logger = nativePlatform.getNativeLogger();

    if (stopSending) {
      logger.debug(TAG, "In stopSending mode NOT sending notification!!!");
      return;
    }

    TransportChannelObject senderChannel = transportSenderChannels.get(messageType);
    if (senderChannel == null) {
      throw new NotificationServiceException(
          "Received an unknown message type: '"
              + messageType
              + "', can't find a transport channel to send the notification");
    }

    // send this notification to the correct object based on messageType
    senderChannel.sendNotification(
        version,
        msgId,
        messageType.getTypeId(),
        deviceId,
        deviceName,
        appId,
        appName,
        attributes,
        customAttributes,
        text,
        ttl);
  } // sendNotification