I need some advice on sending pus notifications to my android app built in android studio. I have done a lot of research on the subject but it seems that all the examples, tutorials etc sends one notification to multiple users (similar to a news app that sends a notification about a new article to all of its readers) using GCM, pushbots etc.
What I am trying to achieve is to send a specific account notification to a specific user (similar to a facebook push notification when someone writes on your wall or the bank sending a push notification when a transaction occurs on your account).
The backend data will be on SQL server and as data comes in to the server, notifications needs to be sent to the associated user.
I am not sure if the processing of this happens on the server and then just pushes the notification to the users android device or if there is a service running on the android device which runs in the background and periodically checks for changes in the data and then gives a notification when it detects a change in the data based on certain conditions (more like a pull notification if you will as the android device actually pulls from the server).
Any advice as to where I can start and do more research regarding this will be much appreciated.
Related
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.
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.
It depends on for what reason you're sending the notification.
A local notification is sent locally on the device, so it doesn't need an internet connection. Examples could be:
Send a birthday message when the user has birthday
In a harvesting game, send a local notification when the store is full
A Push Notification is sent from a server and it requires internet on your device to receive it. Examples:
You get a message in a chat while the app is not open (if I understand your question right, this is your case)
In a game: realtime events which are triggered by a server
So in your case, if guess you want to notify the user about new messages if he does not have the app opened. This notification comes from a server and is a Push Notification.
As you describe you want to send notification about sign in users about their messages. so it would be the real time notification about when there is message for user you need to notify the user. so apple having PushNotification is the best approach you need to apply for this. using that you can directly notify user about the new messages.
Why LocalNotification is not useful in this scenario?
I think messaging is the realtime stuff. local notification is not for that. its for only managing local notify stuff. like reminder OR to do added task.. and many more
In the startup I'm currently working, we have developed a push server that enables the user to receive push notification when new content uploaded in our database.
Our system currently stores how many push are send and through Google analytics we can see how many people interact with the push notification, yet we would like to know how many people in total receive the push notification.
How can we count how many devices recevie the push? Which method could we use? As an example users unistall the app but we still have them stored on our database, or users may opt-out from the push through system settings (both ios and android)
Thanks for the help!
You can achieve it using same analytics by which you are able to identify how many people interacted with push using analytics. you will have to call your analytics function for pushRecieved in broadCastReciever for your GCM implementation.
I am developing a small chat application using node.js for iOS and Android, Now my question is that one user created a account and logged-in using this application from iOS or Android, then the user deleted this application without log-out. How the server knows this device has deleted the application without log-out?. Since, while user again installing this application, the push notification is still arriving without the user log-in.
Apple has a feedback service to give you information about failed remote notifications. Basically you listen the messages from feedback.push.apple.com and you flag the devices returned from feedback service. So no further push notifications will be delivered to that device. When user installs your app again you can remove the flag and start delivering the notifications.
For the android part check this question; Is there an Android GCM equivalent to the iOS Push Notification Feedback Service?
Here I am developing an android app which deals with housing complex.
In this app their are 2 kinds of users:
Builder/Complex Owner
Flat Owner.
Now here the Builder/Complex Owner can send push notification to flat owners.
How can I achieve that? Please help.
Here I cannot use G.C.M as G.C.M. is used for server side push messaging.
Not sure if there is any other way. What you could do is to let the app send a push notification request to the server, then the server would issue the push notification through G.C.M. If you don't have a server available you could do it through text messages but be sure to have a good text messaging plan. You could possibly also use an existing service (for example Facebook) and send the messages through their API.
EDIT:
To do it via text messages: SMS receive with no notification. Again, make sure that you have a good text messaging plan if doing this. Sending an SMS to ten different people will count as ten different SMS messages.. If you have a lot of users it would probably be cheaper to get hold of an SMS server. But then again, you should just use G.C.M.
It is possible to send device to device push notification using gcm.See this link.
This question already has answers here:
How to make a chat application in android? [closed]
(6 answers)
Closed 9 years ago.
I am developing an Android app in which I have to implement chat messaging. I would like one to one chat or a group chat.
But I have no idea how to start. Please help me with this stuff. Any help will be appreciated.
A simple chat mechanism will have 2 basic functionalities
Send the message to server (with info about the recipient)
Receive the message from server (designated for my user name)
First step is simple, we can create a web service which will accept the message with additional information about recipient(s). We can create it using any server side language.
Step 2, that is fetching the message from server can be done using 2 techniques, Pull the message (using polling) from server, or Push the message from server to android phone
Polling: In this, the android device will keep accessing server after a few seconds to check if there is a message available for user. This again can be implemented using a simple async task at the client side which will keep calling a web service after say 2-3 seconds. This is fine to use if we are planning to enable chatting only when user is accessing the app (no notifications like gmail or facebook), so that we can kill the polling service when not in use (otherwise it will eat up resources).
Push notifications: a better option is to use push notifications. Android provide Google cloud messaging or GCM (http://developer.android.com/google/gcm/index.html) which will help achieve push from server easily. Otherwise you can try a third party API like urbanairship or pushwoosh depending on your requirement. Push notifications will help the user to receive messages even when he is not using the app.
So in nutshell, a webservice to receive the messages and a push notification mechanism should be sufficient to implement a chat service in android.
Little bit about UrbanAirship
I used UA in one of my projects for push notifications as I needed to support both iOS and Android. If you just want to support Android GCM might also be a good option.
Coming back to UA, check this for sample code and usage: https://docs.urbanairship.com/display/DOCS/Home
The way it works is simple, when someone installs the app and is connected to internet, app registers itself to the UA service. A unique code is specified for each installed app (this is the time when you can capture the user name and unique code and store somewhere in your DB). Next UA provides an API using which you can push a message to designated recipient(s), using the unique codes which are available with UA. These messages can be received by android app and used as per the requirement. Even if the app is not running we can show a notification just like when we receive an email or a message
You can use an existing platform like Scringo. It gives you a one-on-one chat as well as group chat (both the client and the server) as well as the push notification service.