Class PushNotificationException
- All Implemented Interfaces:
Serializable
The reason codes are the wire contract's error vocabulary (PUSH-WIRE-CONTRACT section 1.3) plus the codes only the Java API can meet: PERMISSION_DENIED, GESTURE_REQUIRED, NO_DEVICE, NO_USER and - ruled 2026-09-24, PUSH-PROPS-DESIGN section 4.6 - UNSUPPORTED, TIMEOUT and KEY_CONFLICT, and DISMISSED (since P4-09, the subscribe action). Of the wire's own codes the Java API reports BAD_REQUEST, NOT_CONFIGURED (since P4-07), STORE_FAILURE and INTERNAL. The message is for a log and is never parsed.
The user text (getUserText(), CC-FIX-IIZIRUN-RESUME-RECONNECT, AP-D-2 (c) of CC-PROVE-ANDROID-PUSH-SIGNIN): what the user can be shown for the failure and can do about it, in English, never null - for permission_denied on a phone "Notifications are off for this app: turn them on in the phone's Settings.", since a phone whose user once refused is never asked again and nothing else tells the user why nothing happens. The message stays the log's. An application with a text table of its own uses reason as the key of its entry.
- Author:
- Christopher Mindus
- See Also:
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe reason "bad_request": an argument was refused, e.g.static final StringThe reason "dismissed": the user closed the permission prompt a subscribe action's click raised without answering it; the permission stays undecided and the next click asks again (P4-09, PUSH-PROPS-DESIGN section 8.3).static final StringThe reason "gesture_required": a Browser subscription needs the user's click.static final StringThe reason "internal": anything else, the engine not running included; the message never carries a stack trace.static final StringThe reason "key_conflict": the Browser already holds a push subscription under another VAPID key, and it is never replaced (RR-21 A); or a Cordova device's FCM token belongs to another Firebase project than the application's, as it does inside iiziRun Developer (ruled 2026-09-26, CC-PUSH-ROADMAP row 4 A), and no row is stored for it.static final StringThe reason "no_device": this session has no channel to a device - a Designer, Design Viewer or VSViewer session, a client built before the channel existed, or a channel that reported no device UUID - so no client-bound call can reach one.static final StringThe reason "no_user": the session has no authenticated user, so nothing can answer for "the session's user".static final StringThe reason "not_configured": the application offers no transport this device can be reached through - no VAPID key pair for a Browser, no Firebase project for a Cordova device - so a subscription could never be delivered to (PUSH-WIRE-CONTRACT section 5.1's 409, met by the Java API'ssubscribesince P4-07).static final StringThe reason "permission_denied": the user refused notifications; final until the user changes it in the Browser's or the operating system's settings, and no code can ask again.final StringThe reason code, nevernull.static final StringThe reason "store_failure": the subscription store failed.static final StringThe reason "timeout": the client did not answer a client-bound call by its deadline, 30 seconds, or 5 minutes for a subscribe that may show a native prompt (RR-10 A, RR-11 A).static final StringThe reason "unsupported": the device cannot receive Push Notification at all (RR-10 A).Constructor Summary
ConstructorsConstructorDescriptionPushNotificationException(String reason, String message) Constructor: the user text isuserText(String,PushTransport)of the reason without a transport.PushNotificationException(String reason, String message, Throwable cause) Constructor with a cause.PushNotificationException(String reason, String message, Throwable cause, String userText) Constructor with a cause and the text for the user.Method Summary
Modifier and TypeMethodDescriptionGets the text for the user: what the user can be shown for this failure and can do about it, in English, nevernull.static StringuserText(String reason, PushTransport transport) The text for the user of a reason code, in English: forPERMISSION_DENIEDwhere to turn notifications on again - the phone's Settings for a device reached byPushTransport.FCM, the Browser's site settings for one reached byPushTransport.VAPID, both when the transport is unknown - and what to do for the other codes; a code this class does not know gets the general text.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Field Details
PERMISSION_DENIED
The reason "permission_denied": the user refused notifications; final until the user changes it in the Browser's or the operating system's settings, and no code can ask again.- See Also:
GESTURE_REQUIRED
The reason "gesture_required": a Browser subscription needs the user's click. Not an error in the application's code: configure the subscribe action and let the user press the button.- See Also:
DISMISSED
The reason "dismissed": the user closed the permission prompt a subscribe action's click raised without answering it; the permission stays undecided and the next click asks again (P4-09, PUSH-PROPS-DESIGN section 8.3). Only a click reports it.- See Also:
NO_DEVICE
The reason "no_device": this session has no channel to a device - a Designer, Design Viewer or VSViewer session, a client built before the channel existed, or a channel that reported no device UUID - so no client-bound call can reach one.- See Also:
NO_USER
The reason "no_user": the session has no authenticated user, so nothing can answer for "the session's user".- See Also:
UNSUPPORTED
The reason "unsupported": the device cannot receive Push Notification at all (RR-10 A).- See Also:
TIMEOUT
The reason "timeout": the client did not answer a client-bound call by its deadline, 30 seconds, or 5 minutes for a subscribe that may show a native prompt (RR-10 A, RR-11 A).- See Also:
KEY_CONFLICT
The reason "key_conflict": the Browser already holds a push subscription under another VAPID key, and it is never replaced (RR-21 A); or a Cordova device's FCM token belongs to another Firebase project than the application's, as it does inside iiziRun Developer (ruled 2026-09-26, CC-PUSH-ROADMAP row 4 A), and no row is stored for it.- See Also:
NOT_CONFIGURED
The reason "not_configured": the application offers no transport this device can be reached through - no VAPID key pair for a Browser, no Firebase project for a Cordova device - so a subscription could never be delivered to (PUSH-WIRE-CONTRACT section 5.1's 409, met by the Java API'ssubscribesince P4-07).queryAvailableTransportstells beforehand.- See Also:
BAD_REQUEST
The reason "bad_request": an argument was refused, e.g. a notification that supplies the reserveddata.iizimember (PUSH-WIRE-CONTRACT section 6.2).- See Also:
STORE_FAILURE
The reason "store_failure": the subscription store failed.- See Also:
INTERNAL
The reason "internal": anything else, the engine not running included; the message never carries a stack trace.- See Also:
reason
The reason code, nevernull.
Constructor Details
PushNotificationException
Constructor: the user text isuserText(String,PushTransport)of the reason without a transport.- Parameters:
reason- The reason code.message- The message.
PushNotificationException
PushNotificationException
Constructor with a cause and the text for the user.- Parameters:
reason- The reason code.message- The message.cause- The cause, ornull.userText- The text for the user, ornullfor the reason's own without a transport (userText(String,PushTransport)).
Method Details
getUserText
userText
The text for the user of a reason code, in English: forPERMISSION_DENIEDwhere to turn notifications on again - the phone's Settings for a device reached byPushTransport.FCM, the Browser's site settings for one reached byPushTransport.VAPID, both when the transport is unknown - and what to do for the other codes; a code this class does not know gets the general text.- Parameters:
reason- The reason code, ornull.transport- The device's transport, ornullwhen unknown.- Returns:
- The text, never
null.