-
Notifications
You must be signed in to change notification settings - Fork 2
DeliveryResult
Viames Marino edited this page Feb 22, 2026
·
1 revision
Pair\Push\DeliveryResult is a value object representing the outcome of one push delivery attempt.
-
success(bool) -
statusCode(?int) -
error(?string) -
endpoint(string) -
shouldDeleteSubscription(bool)
new DeliveryResult(
string $endpoint,
bool $success = false,
?int $statusCode = null,
?string $error = null,
bool $shouldDeleteSubscription = false
)$results = $dispatcher->sendToUser($userId, $notification);
foreach ($results as $result) {
if ($result->success) {
continue;
}
// log issue
error_log('Push failed for ' . $result->endpoint . ': ' . ($result->error ?? 'unknown'));
if ($result->shouldDeleteSubscription) {
// already handled by dispatcher in default flow
}
}-
success=truemeans provider accepted delivery. -
statusCodemay be null when provider report is unavailable. -
shouldDeleteSubscription=trueindicates stale/invalid endpoint (typically HTTP 404/410).
See also: PushDispatcher, WebPushSender, Notification.