2

Is there any way through which one can send push notifications to specific user/device? This both question gives me enough understanding to send push notification to android devices:

If I want to send notifications to specific users in Cordova, how can I send?

Community
  • 1
  • 1
Nehil Mistry
  • 1,101
  • 2
  • 22
  • 51
  • we can send push notification to the specific user based on the authentication module in that you will take login user details and passing those values to the push notification, So these userId's is stored in push notification if they are subscribed users, Then we can send notification to that user. – Hanuman Apr 28 '15 at 05:56

2 Answers2

1

For this purpose your will need:

  1. A server that can authenticate your users and store their push notification IDs.
  2. A cordova plugin that will accept push notifications sent from your server and pass it on to your application.

For the cordova plugin, I'd suggest PushPlugin

Assuming you have a server where your user credentials are stored, add structure and an API to store user's push notification IDs and methods to send notifications to selected users. All this will depend on what platform you choose for your server.

Ajoy
  • 1,838
  • 3
  • 30
  • 57
0

in your server Send a message using GCM HTTP connection server protocol:

https://gcm-http.googleapis.com/gcm/send
Content-Type:application/json
  Authorization:key=<API KEY>
  {
    "to": "GCM ID",
    "data": {
      "message": "This is a GCM Topic Message!",
     }
  }

If you change the GCM id with the specific users GCM id you can send the push notification to the specific user for more details please go through the following link

http://phonegaptut.com/2016/05/31/how-to-send-push-notifications-in-phonegap-application/

Jobincs
  • 4,003
  • 2
  • 14
  • 11