Notification with openfire in android and ios - android

Developing an application for android and ios with openfire server with asmack(for android). successfully implemented all stuff(one to one chat also group chat). now stuck in how can I implement notification with openfire server specially users get offline, tried with google but it didn't help. Any help appreciate...

If B gets offline and you want A to know about it. Roster is the thing you need. When users subscribe to each other on roster, then When B goes online/offline, All users who subscribed to B will get to know.
If B gets disconnected from your chat server and A sends some message, and you want to have a notification on B, then you need push notification here. As described by #ShoaibGondal "If you are talking about google push, then that is not supported in Openfire unless you find some plugin online or custom changes in your openfire deployment.– Shoaib Ahmad Gondal"

Related

How can I set up an app server to send device to device notification via FCM?

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!

Client triggered Parse.com Push notification

I am creating a simple forum app for ANDROID using Parse. I am stuck at a problem related to notifications
For instance I want that when user A posts a comment in a forum app, user B (who subscribed to that post) will receive a push notification, can I do that using either client code, instead of handling it using Cloud Code, or the REST API? If not then how to I start developing the server side to use cloud code or REST API
Allowing users to send push notifications via the client is bad for security reasons. It's not incredibly difficult to get the application id and client key to an app. Anyone with that information will be able to create their own code that allows them to target whoever they want with push notifications if client push is enabled.

Architecture of Android Push Notification

I am trying to implement something similar to Google Cloud Messaging and I have a working XMPP service on my phone and XMPP server configured.
Could someone please tell the architecture on the phone? How does android know when to show a notification for an incoming message? and when to update the application?
For Example, In Google Hangouts, when you get a new message, the notification is displayed and if the user is in the conversation frame, the conversation gets updated.
For notifications you have to go through this tutorial android notifications, the client libraries like smack abstract for you the communication between XMPP Server and clients, you listen to incoming Messages and whenever a message arrives you display a notification. I hope this could help you.

Push Notifications status check Android

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.

Chat algorithm with websockets and gcm

I have a chat web site and I builded an app of this site.Now my site and app using socket.io(websocket).In current version of my app when user closes the app user can't recevie any message(normally).I decided add GCM support to my app for push notifications.But I have questions about this.
My scenario:
User 1 logged into system from pc then he connected to socket.io
server and he is waiting messages.
User 2 logged into system from android app then he connected to
socket.io server.
Now they are chatting with each other.
But 10 minutes later user 2 closed the app and now he won't receive messages.
I am asking what should I do for send push notifications to user 2 ?
I am not asking GCM implemention,I know the GCM implemention.I know the user 2 device id and how can I send push notification to this user.
My problem is:I need to work with socket.io and GCM.How can I detect "okay,user 2 closed the app when user 1 sends a message to user 2 take this message and send to gcm server"
Is this a good approach ? or what do you suggest for like this chat system ? Example you can give an example from Whatsapp how can they handle this problem ? I think they are using Gcm for only push notifications,in app they are using Erlang.
It's not socket.io that connects to the GCM.
You'll need a module for Node.js that enables the connection from the Node.js (running the socket.io) to the GCM. A module like this one gcm module, there are also examples that can get you started.
So, in your case, you'd want to call socket.emit() if the user is online (you should have this already), otherwise the user is offline and you want to push the message by calling gcm.send().
To detect if the user is offline you'd need the to add the user to an offline list when the socket.on('disconnect',function(){//add user to offline list}) handler is called.

Categories

Resources