1

I am creating an Android app where in I require to send the push notifications to a particular device like whatsapp sending as the notfication when a new message comes.

I can send notifications to multiple Devices very perfectly..There is no issue at all..

Here the query is How can I send Notification to particular device (or user).

What should be done to send the push notification to the particular individual user in Android?

Can any give me an idea

Thanks in Advance

Gopal Singh Sirvi
  • 3,923
  • 5
  • 25
  • 47

2 Answers2

2

First register the device to GCM and get the gcm key. Send the notification to that device manually using the GCM key. Curl request to do so is

curl --header "Authorization: key=" --header Content-Type:"application/json" https://android.googleapis.com/gcm/send -XPOST -d '{"data":{"New message through curl"},"registration_ids":["<RegId1>"]}'

To send it using PHP go through following

GCM with PHP (Google Cloud Messaging)

Community
  • 1
  • 1
Santosh Jagtap
  • 965
  • 7
  • 16
0

I think you have to make a matching like user->reg id and store it in some storage on the third party server. After that you can pick a user and his reg id to send it to.

Andy
  • 883
  • 1
  • 8
  • 17