Class FcmTransport
- All Implemented Interfaces:
IPushTransport
POST https://fcm.googleapis.com/v1/projects/{project}/messages:send with an OAuth 2.0 bearer token minted from the application's service account.The subscription is the registration token the Cordova client obtained from the FirebaseX plugin. Both Android and iOS devices are reached here: with the plugin in FCM mode the iOS token is an FCM registration token and FCM relays through APNs (ruling on the iOS transport, 2026-09-06). An PushTransport.APNS row, a raw APNs token registered by the legacy client branch, is not this transport's.
Message mapping: notification.title, body and image from the message; data from options.data, every value a string as FCM requires; android.ttl and apns-expiration from the TTL; android.priority and apns-priority from the urgency; android.notification.tag and icon from options.tag and options.icon.
Status mapping: 200 delivered; 404 with UNREGISTERED, or 400 whose error names the registration token, endpoint stale; 429, 500, 503 transient with Retry-After; 401 and 403 the credentials, permanent and the cached token dropped; other 4xx permanent.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionvoiddispose()Releases the transport's resources.getKind()Gets the transport kind.Gets whether this transport can send for an application.send(SubscriptionRecord subscription, PushMessage message, long ttlMillis, DeliveryUrgency urgency) Sends a notification to one subscription.
Constructor Details
FcmTransport
Constructor.- Parameters:
client- The started Jetty client.configs- The application configurations.
Method Details
getKind
Description copied from interface:IPushTransportGets the transport kind.- Specified by:
getKindin interfaceIPushTransport- Returns:
- The kind.
getState
Description copied from interface:IPushTransportGets whether this transport can send for an application.- Specified by:
getStatein interfaceIPushTransport- Parameters:
appId- The application ID,*for iiziRun.- Returns:
- The state, never null.
send
public TransportResult send(SubscriptionRecord subscription, PushMessage message, long ttlMillis, DeliveryUrgency urgency) Description copied from interface:IPushTransportSends a notification to one subscription. Blocks the calling (virtual) thread until the push service has answered or the request timed out.- Specified by:
sendin interfaceIPushTransport- Parameters:
subscription- The subscription.message- The notification.ttlMillis- The effective time-to-live in milliseconds, already defaulted and clamped by the engine; converted to seconds at the header only.urgency- The effective urgency.- Returns:
- The result, never null; a failure is an outcome, never an exception.
dispose
public void dispose()Description copied from interface:IPushTransportReleases the transport's resources.- Specified by:
disposein interfaceIPushTransport