Sends a push notification to the APNs gateway.
This method returns a
Future that indicates whether the notification was accepted or rejected by the
gateway. If the notification was accepted, it may be delivered to its destination device at some time in the
future, but final delivery is not guaranteed. Rejections should be considered permanent failures, and callers
should not attempt to re-send the notification.
Future may fail with an exception if the notification could not be sent. Failures to
send a notification to the gateway—i.e. those that fail with exceptions—should generally be considered
non-permanent, and callers should attempt to re-send the notification when the underlying problem has been
In particular, attempts to send a notification when the client is not connected will fail with a
ClientNotConnectedException. If the client was previously connected and has not been explicitly
disconnected (via the
ApnsClient#disconnect() method), the client will attempt to reconnect
automatically. Callers may wait for a reconnection attempt to complete by waiting for the