problem description
when you do IM live chat, when you receive a message, you will display a small red corner sign on the icon of App, and there are several unread messages. Then the chat list shows the number of unread messages for a specific person, and the total number of messages pushed is the total number of messages pushed. It seems that there is no problem with the logic that the corner mark for reading someone"s messages is how many messages have been read and how many messages have been subtracted. When app is not started, or press the home button to exit to the background kill and drop app, you can still receive a notification message. Just at this time, the corner mark will not increase progressively, and searching Baidu and google, is still fruitless:
the environmental background of the problems and what methods you have tried
- the App, of a process that is not started or dropped by kill cannot be incremented into the code in App, so it can only be set through the server badge field .
- through the server setting, the server needs to know how many messages have been read by the client and has to report the number of unread messages. At this time, the answer seems to be very clear, so let"s do it
- Silent push has no message display or sound. It is said that silent push can perform background tasks for dozens of seconds, but each push comes to an abrupt end (once every 3 seconds in a background cycle). Later, it was learned that Apple stipulates that background tasks can be used a limited number of digits within an hour. So. I don"t know what to say (but Wechat"s news corner mark can always be increased).
something terrible happened, that is, when the flight mode is enabled, all unread messages are read off, and then exit to the background kill drop App, and then dozens of messages are crazily pushed by the backend. At this time, the number of unread messages has not been reported in time, so this operation will cause inconsistency between the front and back ends of unread messages, and users will be disgusted if they feel that the data is abnormal. Uninstall App and other operations
because Wechat has achieved this function perfectly, I don"t know how they achieve it, so this is very embarrassing.
what result do you expect? What is the error message actually seen?
look forward to netizens to provide ideas, thank you in advance