Class AppSessionPushAPI
- All Implemented Interfaces:
IAppSessionPushNotificationAPI, IPushNotificationCommonAPI, PushEvents.ISink
IAppSessionGyro.getPushNotificationAPI() (P4-04): the fan-out sends and the count, which need no channel and work from this order on through the device tier, and the six delegating calls (resetDeviceEverywhere since P4-08, P4-b), which hand over to the client session's IPushNotificationAPI and re-post its answer to this session's worker (PUSH-PROPS-DESIGN section 4.3).A send is the engine's, exactly as the HTTP push is: the same message ID under data.iizi, the same filter, the same result per target. The callback receives one IPushTargetOutcome per subscription the send matched, with the user's name, so a developer sees which device failed and why (contract 9.3). The time-to-live is the option's, else the notification's own, else the application's TTL property, else the server default (contract 6.4, P4-03).
A send names the application's own subscriptions only: the filter carries this session's application. The Topic is what the declaration says: the empty string is the application-level subscription, so sendToTopic("") reaches the subscribers that chose no Topic, and countSubscriptions("") counts them - not every Topic, which is countSubscriptions(null).
- Author:
- Christopher Mindus
Field Summary
Fields inherited from class PushSessionAPI
ctxConstructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionvoidcountSubscriptions(String topic, BiFunction<Integer, Exception, Void> callback) Counts the subscriptions of this application and topic, of every user: whatIAppSessionPushNotificationAPI.sendToTopic(String, IPushNotification, PushSendOptions, BiFunction)would match now.voidqueryDeviceState(IClientSessionGyro client, BiFunction<IPushDeviceState, Exception, Void> callback) Queries the Push Notification state of a client's device, asIPushNotificationAPI.queryDeviceState(BiFunction)does.voidresetDevice(IClientSessionGyro client, BiFunction<Integer, Exception, Void> callback) Removes every subscription of the user on a client's device for this application, asIPushNotificationAPI.resetDevice(BiFunction)does (ruled 2026-09-24, RR-15 B): other applications' rows survive.voidresetDeviceEverywhere(IClientSessionGyro client, BiFunction<Integer, Exception, Void> callback) Removes every subscription of the user on a client's device for every application, asIPushNotificationAPI.resetDeviceEverywhere(BiFunction)does (ruled 2026-09-25, P4-b): the HTTPresetwith an empty body, what iiziRun's Reset does on the server.voidsendToClient(IClientSessionGyro client, IPushNotification notification, String topic, PushSendOptions options, BiFunction<IPushSendResult, Exception, Void> callback) Sends a notification to one client's device only, asIPushNotificationAPI.sendToClient(IPushNotification, String, PushSendOptions, BiFunction)does.voidsendToTopic(String topic, IPushNotification notification, PushSendOptions options, BiFunction<IPushSendResult, Exception, Void> callback) Sends a notification to every subscriber of this application and topic, whoever they are.voidsendToUser(IPushNotification notification, String topic, PushSendOptions options, BiFunction<IPushSendResult, Exception, Void> callback) --- Fan-out ---voidsendToUsers(Collection<String> recipients, IPushNotification notification, String topic, PushSendOptions options, BiFunction<IPushSendResult, Exception, Void> callback) Sends a notification to the named users on every device subscribed for this application and topic, and in-session to each named user's connected client sessions when the delivery mode allows it - for a topic other than the empty string, only when that user holds a subscription for it (ruled 2026-09-26, CC-PUSH-ROADMAP row 2 B).voidsubscribe(IClientSessionGyro client, String topic, BiFunction<IPushSubscribeResult, Exception, Void> callback) Subscribes a client's device, asIPushNotificationAPI.subscribe(String, BiFunction)does, with the same user-gesture rule: on a Browser the call succeeds only when the user has already granted notifications, and failsgesture_requiredat once otherwise - the first subscription of a Browser user comes from a click on the subscribe action (P4-09), never from a server call (ruled 2026-09-24, RR-8 A and RR-9 A) - and with the same reasons otherwise.voidunsubscribe(IClientSessionGyro client, String topic, BiFunction<Integer, Exception, Void> callback) Unsubscribes a client's device, asIPushNotificationAPI.unsubscribe(String, BiFunction)does: the row on this server first, then the device's subscription once no row of this application remains.Methods inherited from class PushSessionAPI
addPushNotificationListener, complete, context, dispose, engine, fail, getPendingCount, isDisposed, isFor, newMessageBuilder, onNotificationAction, onNotificationReceived, onSendFailed, onSubscriptionCreated, onSubscriptionRemoved, queryAvailableTransports, querySubscriptions, removePushNotificationListener, runOff, topics, userMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IPushNotificationCommonAPI
addPushNotificationListener, newMessageBuilder, queryAvailableTransports, querySubscriptions, removePushNotificationListener
Constructor Details
AppSessionPushAPI
Constructor.- Parameters:
ctx- The application session.
Method Details
sendToUser
public void sendToUser(IPushNotification notification, String topic, PushSendOptions options, BiFunction<IPushSendResult, Exception, Void> callback) --- Fan-out ---- Specified by:
sendToUserin interfaceIAppSessionPushNotificationAPI- Parameters:
notification- The notification, built withIPushNotificationMessageBuilder.topic- The topic, the empty string for the application-level subscription.options- The time-to-live, urgency and delivery mode, ornullfor every default.callback- Called on the application session's worker thread with the result and its per-device outcomes, or with the failure; a session with no authenticated user fails with the reasonno_user.
sendToUsers
public void sendToUsers(Collection<String> recipients, IPushNotification notification, String topic, PushSendOptions options, BiFunction<IPushSendResult, Exception, Void> callback) Description copied from interface:IAppSessionPushNotificationAPISends a notification to the named users on every device subscribed for this application and topic, and in-session to each named user's connected client sessions when the delivery mode allows it - for a topic other than the empty string, only when that user holds a subscription for it (ruled 2026-09-26, CC-PUSH-ROADMAP row 2 B).- Specified by:
sendToUsersin interfaceIAppSessionPushNotificationAPI- Parameters:
recipients- User names or e-mail addresses, matched case-insensitively; at least one. A name that matches no user is reported as no outcome rather than as a failure. The wildcard*is not accepted here: a broadcast isIAppSessionPushNotificationAPI.sendToTopic(String, IPushNotification, PushSendOptions, BiFunction), so "everyone" is never the accident of an empty or wildcard list.notification- The notification, built withIPushNotificationMessageBuilder.topic- The topic, the empty string for the application-level subscription.options- The time-to-live, urgency and delivery mode, ornullfor every default.callback- Called on the application session's worker thread with the result and its per-device outcomes, or with the failure.
sendToTopic
public void sendToTopic(String topic, IPushNotification notification, PushSendOptions options, BiFunction<IPushSendResult, Exception, Void> callback) Description copied from interface:IAppSessionPushNotificationAPISends a notification to every subscriber of this application and topic, whoever they are. In-session it reaches the connected client sessions of the users subscribed to that topic; the empty string reaches every connected client session of the application, subscribed or not (ruled 2026-09-26, CC-PUSH-ROADMAP row 2 B). A session without an authenticated user is never reached by a fan-out (row 3 B);IAppSessionPushNotificationAPI.sendToClient(IClientSessionGyro, IPushNotification, String, PushSendOptions, BiFunction)is how it is reached.- Specified by:
sendToTopicin interfaceIAppSessionPushNotificationAPI- Parameters:
topic- The topic, the empty string for the application-level subscribers.notification- The notification, built withIPushNotificationMessageBuilder.options- The time-to-live, urgency and delivery mode, ornullfor every default.callback- Called on the application session's worker thread with the result and its per-device outcomes, or with the failure.
countSubscriptions
Description copied from interface:IAppSessionPushNotificationAPICounts the subscriptions of this application and topic, of every user: whatIAppSessionPushNotificationAPI.sendToTopic(String, IPushNotification, PushSendOptions, BiFunction)would match now.- Specified by:
countSubscriptionsin interfaceIAppSessionPushNotificationAPI- Parameters:
topic- The topic, the empty string for the application-level subscriptions, ornullfor every topic.callback- Called on the application session's worker thread with the count, or with the failure.
queryDeviceState
public void queryDeviceState(IClientSessionGyro client, BiFunction<IPushDeviceState, Exception, Void> callback) Description copied from interface:IAppSessionPushNotificationAPIQueries the Push Notification state of a client's device, asIPushNotificationAPI.queryDeviceState(BiFunction)does.- Specified by:
queryDeviceStatein interfaceIAppSessionPushNotificationAPI- Parameters:
client- A client session of this application session.callback- Called on the application session's worker thread with the state, or with the failure.
subscribe
public void subscribe(IClientSessionGyro client, String topic, BiFunction<IPushSubscribeResult, Exception, Void> callback) Description copied from interface:IAppSessionPushNotificationAPISubscribes a client's device, asIPushNotificationAPI.subscribe(String, BiFunction)does, with the same user-gesture rule: on a Browser the call succeeds only when the user has already granted notifications, and failsgesture_requiredat once otherwise - the first subscription of a Browser user comes from a click on the subscribe action (P4-09), never from a server call (ruled 2026-09-24, RR-8 A and RR-9 A) - and with the same reasons otherwise.- Specified by:
subscribein interfaceIAppSessionPushNotificationAPI- Parameters:
client- A client session of this application session.topic- The topic, the empty string for the application-level subscription.callback- Called on the application session's worker thread with the result, or with the failure.
unsubscribe
public void unsubscribe(IClientSessionGyro client, String topic, BiFunction<Integer, Exception, Void> callback) Description copied from interface:IAppSessionPushNotificationAPIUnsubscribes a client's device, asIPushNotificationAPI.unsubscribe(String, BiFunction)does: the row on this server first, then the device's subscription once no row of this application remains.- Specified by:
unsubscribein interfaceIAppSessionPushNotificationAPI- Parameters:
client- A client session of this application session.topic- The topic, the empty string for the application-level subscription.callback- Called on the application session's worker thread with the number of subscriptions removed, or with the failure.
resetDevice
Description copied from interface:IAppSessionPushNotificationAPIRemoves every subscription of the user on a client's device for this application, asIPushNotificationAPI.resetDevice(BiFunction)does (ruled 2026-09-24, RR-15 B): other applications' rows survive.- Specified by:
resetDevicein interfaceIAppSessionPushNotificationAPI- Parameters:
client- A client session of this application session.callback- Called on the application session's worker thread with the number of subscriptions removed, or with the failure.
resetDeviceEverywhere
public void resetDeviceEverywhere(IClientSessionGyro client, BiFunction<Integer, Exception, Void> callback) Description copied from interface:IAppSessionPushNotificationAPIRemoves every subscription of the user on a client's device for every application, asIPushNotificationAPI.resetDeviceEverywhere(BiFunction)does (ruled 2026-09-25, P4-b): the HTTPresetwith an empty body, what iiziRun's Reset does on the server.- Specified by:
resetDeviceEverywherein interfaceIAppSessionPushNotificationAPI- Parameters:
client- A client session of this application session.callback- Called on the application session's worker thread with the number of subscriptions removed, or with the failure.
sendToClient
public void sendToClient(IClientSessionGyro client, IPushNotification notification, String topic, PushSendOptions options, BiFunction<IPushSendResult, Exception, Void> callback) Description copied from interface:IAppSessionPushNotificationAPISends a notification to one client's device only, asIPushNotificationAPI.sendToClient(IPushNotification, String, PushSendOptions, BiFunction)does.- Specified by:
sendToClientin interfaceIAppSessionPushNotificationAPI- Parameters:
client- A client session of this application session.notification- The notification, built withIPushNotificationMessageBuilder.topic- The topic, the empty string for the application-level subscription.options- The time-to-live, urgency and delivery mode, ornullfor every default.callback- Called on the application session's worker thread with the result, or with the failure.