-
Notifications
You must be signed in to change notification settings - Fork 2
OneSignalNotification
Viames Marino edited this page Feb 23, 2026
·
1 revision
Pair\Services\OneSignalNotification sends push notifications through OneSignal APIs.
Use this service for targeted or segmented push delivery from Pair backend processes.
send(array $userUuids, string|array $title, string|array $message, array $data = [], array $options = []): ?stdClasssendToUser(User $user, ...): ?stdClasssendToUsers(Collection|array $users, ...): ?stdClasssendToSegment(string $segment, ...): ?stdClasscancel(string $notificationId): bool
$result = \Pair\Services\OneSignalNotification::send(
['u_42', 'u_73'],
['en' => 'Shipment update'],
['en' => 'Your order is on the way'],
['orderId' => 2241],
['url' => '/orders/2241']
);\Pair\Services\OneSignalNotification::sendToSegment(
'Active Users',
'Promo',
'Weekend offer is now live',
['campaign' => 'wknd-2026']
);- Missing
ONE_SIGNAL_APP_IDorONE_SIGNAL_REST_API_KEYcauses silent operational failures. - Avoid oversized payloads in
data.
See also: PushDispatcher, Notification, PWA.