Search code examples
iospush-notificationnsnotificationcentersilentpush

iOS: Is it possible to send a push to Notification Center without a sound?


On Android, I can send a silent push that gets delivered to the system tray. On iOS, I'm not sure if this is possible. I removed the alert property from aps, and I'm sending an empty string for sound. What I'm seeing is that the badge count is updated silently (which is good), but there is nothing in Notification Center. So is there a way to send a push to NC without a sound?

Note that I do not want the push to pop up on the screen (i.e. the user should not see it unless they swipe down on the screen to reveal what's been delivered. In other words, I'm trying to match the behavior on Android).


Solution

  • The only way to achieve what you want to do will be to specify "provisional" when asking the notification permission on the device, which is supported on iOS >= 12. This makes the notifications received be completely silent and appear only on the notification center without interrupting the user. However, the user can customize this and choose to be "interrupted" by the notifications, and this permission will also prevent all other notifications from "interrupting" the user.

    If you want to selectively specify some notifications to only go to the Notification Center, while others make sounds and show as notification alerts to the user, then the answer to your question is no, its not possible.