Easy Coder
Easy Coder

Reputation: 325

What the best way to consistently get updates from Server in mobile app?

I am trying to develop an application which displays a game commentary. As you can guess the data gets updated every minute.

I am thinking of using the Push Notifications (APNS/GCM) to notify app of data change and the app will pull down latest data from the server.

But is that the best approach to move forward, should I be considering any other mechanisms? I came across few like

I am not familiar with the above-mentioned concepts. But would like to know the best approach in my scenario.

Thanks

Upvotes: 1

Views: 579

Answers (1)

julianwyz
julianwyz

Reputation: 3172

I would advise against using Push Notifications for that kind of function.

Push Notifications are meant more for marketing or alerting the user of some event - not the backend system. Besides, users can opt out of Push Notifications and could inadvertently break your app because of it.

I have had success with using WebSockets as a way to achieve this. They are pretty straightforward to setup a server to send and receive webhooks (I have used them for NodeJS so here is a link for that - but I am sure there are many similar packages for other languages.

Here is an example library (I am sure there are others as well) that you can use to connect from your app to your backend server.

Hope this helps steer you in the right direction ;)

EDIT: Also just saw you are looking for iOS stuff too, so here is a SocketIO library for iOS

Upvotes: 1

Related Questions