What is difference between remote notification and silent notification in iOS?

后端 未结 3 830
攒了一身酷
攒了一身酷 2020-11-22 15:26

When I read Apple Docs, they mention 3 types of notification: local, remote, and silent.

Local notification can be inferred from its name, that is sent by the app loc

3条回答
  •  [愿得一人]
    2020-11-22 15:37

    The push notification will let the user know that they receive a notification (Showing the notification popup for example). The silent notification will update, but the user won't get notified about it. In any case, you can perform actions when notified with silent, just as if it was a push notification. The only difference is the user will not get notify with the popup notification.

    With push notification:

    With silent notification:

    The difference is in the payload:

    Push notification:

         aps {
           content-available: 1
           alert: {...}
         }
    

    Silent notification:

        aps {
          content-available: 0
          alert: {...}
        }
    

    And you have to set in Capabilities the background mode you choose.

提交回复
热议问题