Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Let's say a user has a messages app on their iPhone and iPad. They get a new message from the server, so a push notification is sent to both their devices. Now the user picks up their iPhone and reads the message waiting in notification center. How do I now remove the message from notification center (and the app badge number) on their iPad, since it's already been read?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
955 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...