How to automatically delete push notifications from iOS notification centre at a specific time?

后端 未结 3 2125
借酒劲吻你
借酒劲吻你 2020-12-19 12:30

I am developing an iOS app using Swift which has push notification feature. The app sends Birthday reminders notifications to the users via push notifications (APNS used her

3条回答
  •  臣服心动
    2020-12-19 13:09

    In case anyone else ends up here looking for a way to clear notifications without sending a background push, I spent a few hours attempting to replicate the accepted answer, specifically:

    you can delete that notification from the device's notification center by sending another request to APNS by Passing the apns-id value in the request header.

    And it did not work for me at all. As far as I can tell the only way to remove notifications is via a content-available background push. Though I would love to be proven wrong!

提交回复
热议问题