User can disable push notifications in later versions of android for an application, is there any way application can know that push notifications are disabled by user in settings ?
Look here: http://developer.android.com/google/gcm/adv.html#unreg
There one way is explained.
Another way could be:
If you have implemented a GCM server then your app sends a message to the server that it does not want any updates anymore.
After that the server deletes the regId from its devices database.
From now on your device should not get any Push Messages.
You could also try to make a client side decision and filter the messages if the user does not want any push messages (that way they would still be sent on the server side)
So I would implement a server side solution. Seems to be the cleanest way for me.
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
I have set up push notification from Firebase console and I can send push notifications. However, I cannot send device-to-device notification yet. As I gather I would need an external app server that would observe Firebase nodes for change and then would fire off a notification via FCM.
I have seen similar question in SO here and a good but brief and not so complete explanation by Frank van Puffelen here. But I am still quite confused. Any tutorial or help as to how I can set up an app server (XMPP here) that would do the communication between client app instances and Firebase for sending notification when ChildAdded or modified and handling the key exchanges would be appreciated. (as I understand, FCM needs XMPP protocol for sending upstream notification)
Any help would be appreciated.
Following this tutorial.
Send Notifications from Server
What you can do is, setup an external server using your favorite technology to listen child_added or changed and respond to the notification requests.
We used the node.js app engine to handle this. Again the funda is to move people to use other cloud paid services.
Yours it's a good question... The firebase can't send push device-to-device, then if you want to do this one, needs a app server as you said. The other possibility that I thought for a long time is a create a independent service to do two things, the first one is constantly controls events as onChildAdded, for exemple and the second one, throws local notifications.
This is solution that i think works fine before to create a app server... At final if you try to do it, explain us your experience please! Greetings!
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.
I'm just beginning to learn about REST and push notifications and am looking to see if I'm correct in what I'm thinking.
1.) -
A push notification is sent when the server changes state and has the advantage over constantly pinging the database for the most updated data, when it has new data it just sends it out to whomever is listening.
2.) -
You have to use REST to have a push notification. This I'm not really too sure about, is it possible to send push notifications without using REST?
There are many different services to send push notifications. IBM Bluemix www.ibm.com/bluemix, Facebook www.parse.com and a few others that make it easier to send push notifications without using REST. Good luck
I am searching for information about custom push notification.
I want to implement a tunnel between server and devices (Android and iOS). When it comes a time server should send information to device (App).
Also as i know push works just in one way and server don't know if it's message has reached device. Maybe i am wrong at this statement, so please correct me.
I my case i want that server could know this information. So my question would be how to create this behavior between server and device (Android, iOS). Maybe there are some libraries or even protocol name where i should look.
At this moment i am reading about push notification named MQTT
I would appreciate for any information.
Thank you.
What you're looking for is Google Cloud Messaging for Android, and Apple Push Notification Service on the iOS side. (There's also Azure in Windows Mobile, but nobody really seems to care due to the cost.
And yes, you're correct in your assertion that push notifications are one-way. However, it is relatively simple to provide an acknowledgement path back to the server, if the device is in connectivity. In response to the notification, you can simply have the device post a token to the server, confirming the receipt of the push notification.