Sender
Facade to send push-messages.
Table of Contents
Methods
- send() : Result
- Sends $message to $userId through $channels.
- sendContextMessage() : Result
- For sending different messages through different channels, for example, to send a message without a body through an internal channel to instantly intercept an event.
- sendImmediate() : Result
- Sends $message to $userId through Application and Device channels.
Methods
send()
Sends $message to $userId through $channels.
public
static send(int $userId, Message $message[, array<string|int, Channel>|null $channels = null ]) : Result
By default, uses ApplicationChannel only. It means that message will be delivered when user opens his mobile application.
Parameters
Return values
ResultsendContextMessage()
For sending different messages through different channels, for example, to send a message without a body through an internal channel to instantly intercept an event.
public
static sendContextMessage(int $userId, Message $applicationMessage, Message $deviceMessage) : Result
Parameters
Return values
ResultsendImmediate()
Sends $message to $userId through Application and Device channels.
public
static sendImmediate(int $userId, Message $message) : Result
It means that message will be delivered as system push-notification, even mobile app is closed.
Parameters
- $userId : int
- $message : Message