Interface IPushNotificationListener
IPushNotificationCommonAPI.addPushNotificationListener(IPushNotificationListener) and held in a com.iizix.GenericListener.Every method is called on the worker thread of the session whose API the listener was added to, never on an engine, transport, servlet, database or WebSocket thread. Every method has an empty default, so a listener implements only the events it wants.
Receipts can repeat. One notification can be reported more than once by one device: shown in-session and by device push on the same Browser under DeliveryMode.BOTH, or drained from the Service Worker's queue by a page that also saw it live. The server drops a repeat of the same (message, device, kind, action) reported within 10 minutes and delivers one older than that (PUSH-PROPS-DESIGN section 7.4, ruled 2026-09-24 RR-13 A): an application that keys on the message ID sees at most one per window, and should tolerate a late second.
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe reason "endpoint_stale" ofonSubscriptionRemoved(IPushSubscriptionInfo, String): the push service reported the subscription gone (DeliveryOutcome.ENDPOINT_STALE).static final StringThe reason "reset" ofonSubscriptionRemoved(IPushSubscriptionInfo, String): the device, or an administrator, reset every subscription of the device.static final StringThe reason "retention" ofonSubscriptionRemoved(IPushSubscriptionInfo, String): the subscription was not seen for longer than the server's retention setting.static final StringThe reason "unsubscribed" ofonSubscriptionRemoved(IPushSubscriptionInfo, String): the device unsubscribed.Method Summary
Modifier and TypeMethodDescriptiondefault voidonNotificationAction(IPushReceipt receipt, String action) Called when the user clicks a notification of this application, or one of its actions - also when the click is what opened the application, once its session listens.default voidonNotificationReceived(IPushReceipt receipt) Called when a client reports that a notification of this application was shown on its device: by the Browser's Service Worker for a device push, by the page for an in-session delivery, by the Cordova app for a message it received in the foreground (a notification shown while a Cordova app is in the background runs no JavaScript and is reported only if tapped).default voidonSendFailed(String messageID, IPushTargetOutcome outcome) Called when one target of a send ends in an outcome that is neither a delivery, nor held in the spool, nor a deliberate exclusion:DeliveryOutcome.ENDPOINT_STALE,DeliveryOutcome.TRANSPORT_REJECTED,DeliveryOutcome.TRANSPORT_NOT_CONFIGURED,DeliveryOutcome.EXPIRED,DeliveryOutcome.UNRESOLVABLE_RESIDENCY,DeliveryOutcome.IN_APP_SESSION_USER_CLOSED_ALL_SESSIONSorDeliveryOutcome.KEY_MISMATCH.default voidonSubscriptionCreated(IPushSubscriptionInfo subscription) Called when a subscription of the session's user for this application is stored, whichever session or device stored it.default voidonSubscriptionRemoved(IPushSubscriptionInfo subscription, String reason) Called when a subscription of the session's user for this application is removed.
Field Details
REMOVED_UNSUBSCRIBED
The reason "unsubscribed" ofonSubscriptionRemoved(IPushSubscriptionInfo, String): the device unsubscribed.- See Also:
REMOVED_RESET
The reason "reset" ofonSubscriptionRemoved(IPushSubscriptionInfo, String): the device, or an administrator, reset every subscription of the device.- See Also:
REMOVED_ENDPOINT_STALE
The reason "endpoint_stale" ofonSubscriptionRemoved(IPushSubscriptionInfo, String): the push service reported the subscription gone (DeliveryOutcome.ENDPOINT_STALE).- See Also:
REMOVED_RETENTION
The reason "retention" ofonSubscriptionRemoved(IPushSubscriptionInfo, String): the subscription was not seen for longer than the server's retention setting.- See Also:
Method Details
onSubscriptionCreated
Called when a subscription of the session's user for this application is stored, whichever session or device stored it.- Parameters:
subscription- The subscription.
onSubscriptionRemoved
Called when a subscription of the session's user for this application is removed.- Parameters:
subscription- The subscription as it was.reason-REMOVED_UNSUBSCRIBED,REMOVED_RESET,REMOVED_ENDPOINT_STALEorREMOVED_RETENTION.
onNotificationReceived
Called when a client reports that a notification of this application was shown on its device: by the Browser's Service Worker for a device push, by the page for an in-session delivery, by the Cordova app for a message it received in the foreground (a notification shown while a Cordova app is in the background runs no JavaScript and is reported only if tapped). Reaches every listening session of the user and application, including one opened by the click.- Parameters:
receipt- The receipt.
onNotificationAction
Called when the user clicks a notification of this application, or one of its actions - also when the click is what opened the application, once its session listens. On Cordova a tap on a system notification is a click on the notification itself: FirebaseX reports no action identity.- Parameters:
receipt- The receipt of the notification.action- The empty string for a click on the notification itself, otherwise theactionidentity of the clicked action.
onSendFailed
Called when one target of a send ends in an outcome that is neither a delivery, nor held in the spool, nor a deliberate exclusion:DeliveryOutcome.ENDPOINT_STALE,DeliveryOutcome.TRANSPORT_REJECTED,DeliveryOutcome.TRANSPORT_NOT_CONFIGURED,DeliveryOutcome.EXPIRED,DeliveryOutcome.UNRESOLVABLE_RESIDENCY,DeliveryOutcome.IN_APP_SESSION_USER_CLOSED_ALL_SESSIONSorDeliveryOutcome.KEY_MISMATCH.- Parameters:
messageID- The message ID of the send.outcome- The target and its outcome.