ApnsPushProvider class

Apple Push Notification service.

The recipient is the hex device token. Delivery is HTTP/2 only — Apple operates no HTTP/1.1 endpoint — which is why this provider pins DVHttpProtocolChain.http2Only rather than accepting the default chain. A silent downgrade would surface as a connection error that could not explain itself.

Authorization is a bearer JWT signed with ES256 over an Apple .p8 key. Signing that needs an ECDSA implementation Dartvel does not bundle, so the token comes from the application's own credentials layer and is fetched per send — the same arrangement FirebasePushProvider uses, and for the same reason. Apple accepts a token for one hour and refuses one older than that, so a supplier that caches should refresh well inside the hour.

Implemented types

Constructors

ApnsPushProvider({required String topic, required DVAccessTokenSupplier accessToken, ApnsEnvironment environment = ApnsEnvironment.production, ApnsPushType pushType = ApnsPushType.alert, int? priority, DVHttpSend transport = dvSendHttpRequest})

Properties

accessToken → DVAccessTokenSupplier
Supplies the bearer JWT.
final
environment → ApnsEnvironment
final
hashCode → int
The hash code for this object.
no setterinherited
kind → DVNotificationProviderKind
no setteroverride
priority → int
10 delivers immediately; 5 lets the device batch for power. APNS requires 5 for a background push and rejects 10.
final
pushType → ApnsPushType
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
topic → String
The app's bundle identifier, sent as apns-topic.
final
transport → DVHttpSend
final

Methods

buildPayload(DVNotificationMessage message) → Map<String, Object?>
The APNS payload for message.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(String recipient, DVNotificationMessage message) → Future<void>
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited