How do I send a push notification to a single user?

How do I send a push notification to a single user and only to that one?

Hi Felix,

You need to know the device registration ID of that user, which you can set into pushSinglecast: https://backendless.com/documentation/messaging/rest/messaging_publish_push_notifications.htm

Thank your for your quick response!

I want to send it from the Cloud and write it in Java. So where do I get the device ID of the user? And after i got it, how do I publish it in Java?

Here is how you retrieve the current device registration ID: https://backendless.com/documentation/messaging/android/messaging_retrieve_device_registration.htm
And here is how you send the notification: https://backendless.com/documentation/messaging/android/messaging_publish_push_notifications.htm

Okay, but how do I get the device of a specific user given I have the BackendlessUser object? Whose registration does Backendless.Messaging.getDeviceRegistration() return?

In this case you need to save it somewhere manually. Backendless.Messaging.getDeviceRegistration() returns the registrationId of the current user, so you’ll need to call it after registerDevice() and save into your data service.

Okay, thank you.