We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I need to send silent push notification, for which I am using the following code
$authProvider = AuthProvider\Token::create($this->options['ios']); $alert = Alert::create()->setTitle($this->title); $alert = $alert->setBody($this->message); $payload = Payload::create()->setAlert($alert); $payload->setContentAvailability(true); $payload = $payload->setSound('default'); foreach ($this->data as $key => $value) { $payload = $payload->setCustomValue($key, $value); } $notifications = []; foreach ($this->deviceTokens as $deviceToken) { $notifications[] = new Notification($payload, $deviceToken); } $client = new Client($authProvider, $production = false); $client->addNotifications($notifications); $client->push();
It sends the push notification to the device, however, the push notifications are displayed in notification center which I don't want.
How to include content-available=1 to enable and send silent push notification using this library.
content-available=1
The text was updated successfully, but these errors were encountered:
I think you did it
$payload->setContentAvailability(true);
Sorry, something went wrong.
Do NOT set the apn alert object (things like title, body etc), if you leave those out your push is going to be silent.
alert
No branches or pull requests
Hi,
I need to send silent push notification, for which I am using the following code
It sends the push notification to the device, however, the push notifications are displayed in notification center which I don't want.
How to include
content-available=1
to enable and send silent push notification using this library.The text was updated successfully, but these errors were encountered: