Search code examples
notificationsbadgesinch

Sinch didReceiveIncomingMessage: called on initialization incorrectly


If a user receives 20 messages in my app, deletes the app, then reinstalls it, their notification badge on their app icon increments to 20 after the first open of the app. The only time that the badge icon is incremented is in my didReceiveIncomingMessage: a Sinch method that should only be called when the client receives a new incoming message. However, there are no new incoming messages immediately after installation and the badge icon reads the total messages received for this user, leading me to believe that after the sinch client is initialized, the messages registered for this user seem to run though some sort of process that calls the didReceiveIncomingMessage: method for each message. I've tried to understand what's going on during initialization of the Sinch client and research this issue but nothing seems to come up. Any ideas?


Solution

  • Its actually by design, when you install in on a "new" client we will deliver messages for the last 30 days to that device. If you dont want to do badges on that you can check the timestamp and not "consider" is a new. Does that make sense to you?