What are the ways to create a reliable Notification System For ios/Andorid app?
-
I am developing an ios+android app. The app will have users adding other users as friends, comment on others' posts, etc. Therefore, the server will have to notify the users whenever someone adds them as friend, accepts their friend requests or comments on their posts, etc. I am using Apple Push Notification Service and Google Cloud Messaging for push notification. These services are not 100 percent reliable, and moreover, whenever a device is OFF, only the last pushed notification is sent to the device when it is turned on, and others are discarded. For such scenario, how do I make sure users always receive notifications? How popular apps like instagram, path work their way out here? So far, my solution is to keep an archive of the notifications of each user in the database with notification id and also keep track of the notification id in the front end(mobile). Suppose I have received a notification with id 6 and 9(specific to the user) but the last notification received had id 2, this means that the notifications with id 3-5 and 7-8 have not been received. So i will send http request to the server to retrieve all such notifications and then delete all notifications for that user from the database to keep it clean. What are the popular practices? And how good/bad is my solution?
-
Answer:
You could try out App42, I found App42 platform to make it easy, It... You must be signed in to read this answer.Connected to GoogleConnected to FacebookBy continuing you indicate that you have read and agree to the . Loading account...Complete Your ProfileFull NameChecking...EmailChecking...PasswordChecking...By creating an account you indicate that you have read and agree to the .
Nitin Gupta at Quora Visit the source
Other answers
You can implement reliable Push Notification service using any long-living protocol, such as TCP or WebSockets, but I would recommend MQTT protocol for native apps and MQTT-over-WebSocket for web apps. You need to use QoS 2 for guaranteed message delivery in MQTT. There are open-source and commercial implementations of MQTT brokers. My company sells Telecom-grade MQTT broker, which can be easily installed in customers AWS account with SLA for 1 million concurrent users. There are client libraries for both iOS and Android and almost any other OS/programming language. The solution you described is good for your particular case. MQTT is more generic solution. The only problem I see is that can be complicated to allocate sequential notification IDs per user in a scalable distributed system.
Zvi Avraham
Reliable means that you can trust your Push Broker that will deliver the Notification in any case within the maximum validity period possible. This is not possible for Apple APNS for iOS that, as you mentioned, it will send only the latest push if device was previously offline. It would be possible with Google GCM for Android, that will try to bring all Notifications sent, and especially with CCS, where you can use Upstream messages to acknowledge a push notification at the Application layer. Anyway this is still far away from reliable because if you don't have an unified managed solution for that, you can't control all the flow and that's why third party Push Brokers do exist. If you want to make your custom solution, you could just "ack" your push notification one by one to your server (in iOS you would also benefit of Remote Notifications in order to have a feedback by HTTP also while App is in Background) or rely on a connected protocols in order to retrieve automatically all messages, as with MQTT mentioned, or XMPP or with any publish/subscribe real-time system.
Natale Vinto
Generally, the purpose of notifications is to notify the user that there is something new. You should have an update service in your case. To make your notifications reliable you will have have to take care of a lot of things like failover, manage XMPP/APNS connections and track delivery. Hence, people use third-party services. You can use http://www.pushchamp.com for platforms like android/ios/sms/email/chrome/safari. Checkout http://www.pushchamp.com/demo
Abhinav Singh
Notifications are not a replacement for having a correct timeline in your database. All applications you mention update their timeline when the user open the application. This is really easy and straightforward.
Mickaël Rémond
I've never seen problems with GCM. Their service states that the user will receive the push ASAP. Some libraries on nodejs sends repeated notifications to guarantee that the target device gets notified (although not really necessary). Your approach and other approaches I've seen (like Parse) waste a lot of battery, since it'd be necessary to keep the device alive. Just follow the GCM rules and you'll be fine. Same goes for APN.
Mauricio Giordano
For Android: GCM is best since a developer is not required to code or something..its prebuilt in android system, you just need to register you app to receive the intent. Every thing is handled by Android services.Also it has an option to add your own XMPP server implementation to create upstream message.
Ankit Sinha
Related Q & A:
- How to create a calendar in iOS?Best solution by Stack Overflow
- Is it possible to open and flip through a Keynote in my own IOS app?Best solution by stackoverflow.com
- What are some ideas to create a personal blog?Best solution by Yahoo! Answers
- What are easy ways of writing a good essay?Best solution by Quora
- What are some ways be become a swiss resident?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.