On iOS, APNS cannot be relied upon, so what technique do you use for realtime polling of the server?

Hi,

I understand that APNS cannot be relied upon for data delivery and it can be disabled by the user. So, an alternate mechanism must be used for realtime polling of the server.

What do you recommend to do on both client and server?

Many thanks
Jeremy

You’ll want to look into node / socket.io

Here is a link to an example chat client.
http://socket.io/get-started/chat/

There are other options as well as third party solutions such as firebase. However in general we prefer to ‘own’ our stack and run it all on amazon so we are not tied into too many third party services for critical functionality.

What you’re looking for overall is a socket / web socket based approach rather than traditional polling. This will keep things lightweight and real time.

Hi Fox,

Thanks for your quick reply!

  1. This doesn’t drain the battery on the phone since it seems a permanent connection is open with the server?
  2. What happens if the user puts the app to the background/pauses it and the server sends data to the app?

Cheers

Hi,

Should I use a Cordova Plugin or just a javascript library for web sockets?