简体   繁体   中英

How to remove remote notification from notification center after a minute passed?

I am searching for a solution for how to accomplish above, no success so far.

The way it should work:

Notification arrives to device, and after a minute it deletes itself.

What I have already tried:

Sent a silent and a non-silent ( content_available: true / false ) notification to receiver with the previous notification ID, which triggered a method, that deleted the whole notification center's delivered notifications. The problem is it does not called when the app is in terminated state, only when the app is in the background / foreground / suspended.

Is there a legitimate way, to pull this off? I'm open for suggestions and ideas! Thanks in advance!

Unfortunately, the requirement you are checking out is not achievable. When app is terminated, you have no control over notifications area.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM