Reputation: 141
I am creating a social android+ios app and I am using both apple push notification system and google cloud messaging. I am using push notification both while the app is running and not running. I am not using any web-socket while the app is running so notifications are pushed through apns and gcm all the time. I know both are not 100 percent reliable and that is where my confusion arises. What does facebook, instagram, snapchat and other apps do to make sure the notifications are always sent. Do they use websockets when the app is running and apns/gcm when its not running? How can I make sure that something like "friend request" is always notified? Or shall I hit the server now and then to keep the app updated incase it has missed any information which was supposed to be pushed like "friend request"?
Upvotes: 3
Views: 1559
Reputation: 813
As you may know, a "true" push notification is passed off to APNS for ios and GCM for android. Because of this delivery of your message is never guaranteed. For example, from Apple's documentation:
tl;dr is that push notifications are "best effort" and by no means guaranteed. Regardless, you will have to use a provider such as Urban Airship unless you want to build your own, but there are best use-cases. For example, don't send to a highly segmented audience, but instead make a simple request to their API for quicker send times and hopefully more guarantee.
Upvotes: 1
Reputation:
The only option that I would recommend would be Urban Airship, they have a reliable API enough that you could achieve what you're talking about here. There aren't too many good solutions, unless you decided to program your own server for both iOS and Android and take the notifications in-house.
Upvotes: 0