'Send a message to the Lambda APNS gateway.'

def send_message(self, message='', **kwargs):

    data = {ATTR_MESSAGE: message}
    if (kwargs.get(ATTR_TITLE) is not None):
        if (kwargs.get(ATTR_TITLE) != ATTR_TITLE_DEFAULT):
            data[ATTR_TITLE] = kwargs.get(ATTR_TITLE)
    targets = kwargs.get(ATTR_TARGET)
    if (not targets):
        targets = ios.enabled_push_ids()
    if (kwargs.get(ATTR_DATA) is not None):
        data[ATTR_DATA] = kwargs.get(ATTR_DATA)
    for target in targets:
        if (target not in ios.enabled_push_ids()):
            _LOGGER.error('The    target    (%s)    does    not    exist    in    .ios.conf.', targets)
            return
        data[ATTR_TARGET] = target
        req = requests.post(PUSH_URL, json=data, timeout=10)
        if (req.status_code != 201):
            fallback_error = req.json().get('errorMessage', 'Unknown    error')
            fallback_message = 'Internal    server    error,    please    try    again    later:    {}'.format(fallback_error)
            message = req.json().get('message', fallback_message)
            if (req.status_code == 429):
                _LOGGER.warning(message)
                log_rate_limits(target, req.json(), 30)
            else:
                _LOGGER.error(message)
        else:
            log_rate_limits(target, req.json())
