cordovajbossaerogear

aerogear - how to send a push notification to one user


I have a client-server service. The client runs on apache cordova and the server is java based. I need to add push notifications to it and I thought about using aerogear. I read the tutorials and successfully sent a push notification from the cordova app.

I want to be able to send a push notification to just one of the clients. Can this be done using aerogear?

Thanks.


Solution

  • Currently the only way to do it would be to add some "criteria" to the message you are sending that targets a specific installation.

    So during the registration of your device with the Unified Push Server, you can add an alias to the push config, the device token would probably be best:

    var pushConfig = { pushServerURL: "<pushServerURL e.g http(s)//host:port/context >", alias: "<alias e.g. a username or an email address optional>", android: { ... }, ios: { ... } };

    Then when you send your message, you can add that "alias" as a "criteria".

    edit: i've created this JIRA, https://issues.jboss.org/browse/AGPUSH-1117 , to track this