Push-Notification Badge auto increment

前端 未结 5 1143
囚心锁ツ
囚心锁ツ 2020-12-01 03:34

I\'ve been implementing the push service to my application, and I\'ve been thinking about the application\'s badge. My app is a mail app (sorta) and I want to notify the use

5条回答
  •  不知归路
    2020-12-01 04:33

    It is now possible to have the client auto-increment the badge using a UNNotificationServiceExtension.

    Extensions have the ability to modify notification payloads before iOS displays them. In summary, store a badge counter in UserDefaults and modify the notification's badge count as needed. You'll need to add the App Groups capability to share User Defaults.

    Here's a detailed step-by-step guide: https://prodocs.cometchat.com/docs/ios-increment-app-icon-badge-count

提交回复
热议问题