Zain NiaZi Zain NiaZi - 1 year ago 56
Android Question

Which notifications should i use, Push notification or local notification?

I have a cross platform application and i want to send notification to sign in users about their messages.

Now I confused about uses of push, local notifications.
What I think of Push notifications is that it is for sending Announcements to users which is not specifically related to their account only.

Can anyone help me out with what should I use? I already used Local notifications in one of my applications with such requirement.

Answer Source

It mainly depends on; is the data coming from local or remote?

You cannot control when your users open the app, and only when they open the app (with a few exceptions) you are able to fetch data. Then with that data you would be able to schedule a local notification. But in most cases that doesn't make much sense, because they have already loaded and probably seen the data. It only makes sense when you schedule an alarm clock for instance.

When you want the data to come from remote, like when they receive a message, you will have to use push notifications. The user is then alerted that new data is available without having to go look for it themselves. It is pushed to them.

However, for push notifications you will need infrastructure which you did not when using local notifications. You will need a server to handle the push notifications (Azure has some awesome functionalities for this) and some trigger to send push notifications. This can be an insert on a database, or a scheduled task. Also, the user has to enable push notifications and your app has to register itself to be able to receive them. It can be a pain to implement it the first time.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download