Android, push message when app runs? - android

im developing a app in android. I want to send a push message when the client app is currently running. how can i achieve this with Google cloud messaging. or any other methods? but i want to send the push message at app running stage as well as the app closed. thanks in advance. hope someone will help me...

delay_while_idle attribute in gcm message will make GCM Server send message when device is not idling.
Read about cloud messaging it will help to fully understand how this service works. http://developer.android.com/guide/google/gcm/index.html

You cannot push message on the client side.
You can send REST HTTP data to a server.
On server side - use gcm-server library for pushing gcm messages.

Related

How to check if message is delivered using Push Notifications in laravel

I want to know how to check if the message is being delivered at the recipient end or not. I am using this library but not able to figure out how to solve this issue. I have integrated laravel 5.2
The main issue is sometimes message sent from the server but in-app it does not receive. Is there any other way or any alternative to get out of this issue?
Any help/suggestion would be appreciated.
From your server you can only know if you sent the message succesfully to the google server but not if google sent it to the phone. you could create add a method in your rest service to send a kind of status when the notification come to the phone in your MessagingService class.

How can send and receive message between gcm with openfire?

I creating hybrid messenger app using ionic & openfire.
I need push service, so used phonegap-plugin-push.
And succeeded receive push notification from test push server using gcm.
I have questions.
How can send and receive message between gcm with openfire? Because I want make app <=> gcm <=> openfire.
Should I create plugin? or server?
Anybody know openfire gcm plugin? and how to use it?
Have a look at this plugin it may help you
https://github.com/meisterfuu/Openfire-GCM.git

How to send notification through GCM to Java EE web app?

Recently I had to port my Android app to Java EE enviroment . But I'm struggling with the notification process . For now I use Google Cloud Messaging to send notification from "Server A" to Android devices and can't find any clear method to send the same notification to the Java EE web app .
Here's a diagram to clarify what I want to do :
Any body came through this before ? Please share your thoughts .
Choosing Google Cloud Messaging to send notification is a googd decision. You may implement the XMPP Connection Server protocol. It can receive upstream messages from user's device to cloud. When GCM receives an upstream messaging call from client app, it generates the necessary XMPP stanza for sending the upstream message.
I did some research and found out a java-based server: https://github.com/jarlehansen/gcmutils/tree/master/gcm-test-server
Here's the link for starting GCM with explanation of code: https://developers.google.com/cloud-messaging/
You can't implement push notification for you web app itself.
However you can implement them for different client(browsers).
It's easy to implement gcm push notification on Chrome, you can check Google's Doc on that.
But I don't think Firefox/Safari support gcm.

IM client and servers

Can anyone explain how to make a basic IM client with my old PC as a server, client can be on IOS or android? And also please explain how to work with IM and servers simultaniously.
For android you could use Google Cloud messaging and a similar messaging service for IOS. When a client send's a message, it should be sent to GCM via upstream service and GCM will push the message to the server. The server will house the deviceId's of the client's and can push a message whenever required to the client by making a API call to GCM with the message and the deviceID.
Check the documentation for GCM and you will get a clear idea.
There are also other services like GCM which can work for android as well as IOS
The reason for using such a service is that it ensures that the messaging is full proof. Even if the client is not having internet connectivity or is switched off, it shall receive the message on getting internet connection. You do not have to handle those troubles!

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.

Categories

Resources