How to clear the remote notification in your app?

前端 未结 8 1842
青春惊慌失措
青春惊慌失措 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:20

    Swift 3

    In your AppDelegate.swift file under didFinishLaunchingWithOptions add:

    application.applicationIconBadgeNumber = 0
    

    On the launch of your app this will remove the iOS badge (red circle at the top right corner of the app icon).

提交回复
热议问题