How to clear the remote notification in your app?

前端 未结 8 1845
青春惊慌失措
青春惊慌失措 2021-02-04 03:01

Is there a way to clear the remote notification from the notification banner when swiping down from the top of the iPhone screen. I tried setting the badge number to zero:

8条回答
  •  梦如初夏
    2021-02-04 03:30

    I have to increment then decrement badge count in order for it to work:

    application.applicationIconBadgeNumber = 1
    application.applicationIconBadgeNumber = 0
    application.cancelAllLocalNotifications()
    

提交回复
热议问题