How to get data in a web service when receiving a push Notifications with application in idle state

Asked

Viewed 88 times

0

I have an application that when receiving a push notification needs to connect to my web service to get relevant data for the user.

When the application state is active or in the background it can make this connection, but if the application is in its inactive state the connection to the server does not happen.

How should I manipulate the notification when the application state is inactive to perform this connection?

  • 1

    But why don’t you send the required data along with the notification already? Is it a lot of data? At background, the only way to download something is through Background Modes, me I answered a question about it, see if it clears something up for you.

  • @Paulorodrigues, The problem of sending the data along with the notification is the guarantee of delivery. The way it is done today whenever a notification arrives I make the request for all the data that have the id larger than what I have stored in the application. This Background Modes can be a stopgap, however it would not be the ideal solution, because it would make requests at unnecessary times.

  • But the guarantee of delivery is in relation to the notification, without it, gives in the same if the data go together or after it is received, no?

  • @Paulorodrigues, yes the guarantee is in relation to notification, as this today, if I fail to receive a notification, when I receive the next I will have all the data updated, because I always check the application id with the server id, Taking everything that’s happened since the last notification. In short the notification only serves to warn that I have data to search the server.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.