How to invalidate an iOS push notification on iPad when handled on iPhone?

社会主义新天地 提交于 2019-11-29 08:20:00

When the user reads the message on the iPhone (presumably after tapping on the notification or the launch icon of the app), you can execute some API call on your server to notify it that the user read the message.

If you maintain in your server for each user a list of device tokens of all the devices belonging to that user, you can send a push notification to all those devices with badge count 0. This will clear the badge number on the iPad (and any other devices belonging to that user). I'm not sure whether it would remove the message from the notification center of the iPad, though.

As of iOS7, we do not have any API to control the notification center. So clearing the notification is not possible.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!