Send notification from one app to another app on another device in Android
I am creating two different ANDROID apps (each on two separate devices and different locations), one for the user and the other for the merchant. Here I need to send a notification from the trading app to the custom app and vice versa with a button click (usually on different devices and in ANDROIDS), which should be a popup or dialog box. I am really confused about this concept. Can anyone help me on this. The approximate complete source code will be really noticeable as I start working in ANDROID. Thanks in advance..!
+3
source to share
1 answer
use Google GCM service Check here This tutorial will help tutorial
Send messages from the cloud
Send message using GCM HTTP protocol server protocol:
https://gcm-http.googleapis.com/gcm/send
Content-Type:application/json
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA
{
"to": "/topics/foo-bar",
"data": {
"message": "This is a GCM Topic Message!",
}
}
Process the downstream message on your Android device:
@Override
public void onMessageReceived(String from, Bundle data) {
String message = data.getString("message");
Log.d(TAG, "From: " + from);
Log.d(TAG, "Message: " + message);
// Handle received message here.
}
+2
source to share