cancel
Showing results for 
Search instead for 
Did you mean: 

Get Push Registered devices for Notification from cockpit by API MDK

gpic-ahmed-96
Explorer
313

Hello Experts,

We are using SAP MDK and we are trying to implement Push Notifications.

We are facing a challenge trying to get the registered devices for Notification from cockpit by API.

We already setup the needed configuration in MDK and cockpit and we are able now to see the regitred devices in cockpit and send notifications to these devices from cockpit and by RestAPI.

But the challenge that we want to get the registered devices id and users by API to be able to send them notifications automatically from backend system.

I saw the documentation, but nothing is mentioned about that.

Appreciate any help, thank you.

Accepted Solutions (0)

Answers (1)

Answers (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert

How are you planning to establish the mapping between devices and/or registered users and your backend user?

If the backend is trying to send a notification to a subset of all registered users, I would expect that the backend would already know what that group of users is. Then the only question is where is the mapping between backend users and registered users handled. This would be something the backend needs ahead of time to properly send the notification to a subset of the registered users.

You may need to setup a registration table in your backend where on the mobile device after registering for push a transaction can be generated to store the mobile user and device id into a backend table. Assuming the backend connection is using an authenticated individual user the backend can store the mobile user, device id and backend user id into a reference table. Then when your backend needs to notify user x it can lookup the mobile user or device id in order to generate the RestAPI call.

gpic-ahmed-96
Explorer
0 Kudos

Hi Mr. Froelich,

Yes, this our intention we will create some kind of a table and maintain the data there.

The mapping is not a challenge as the registered device in Cockpit already has the user along with the device Id.

But we cannot get that by API.

I saw in Cockpit that we can Export the data which will include the registered device.

But we want to do it by API not manually.

I tried to get the register device after registration Action in MDK but nothiong is return.


bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can get the device and user id values in MDK using the target paths

#Application/#AppData/UserId

#Application/#AppData/DeviceId

I think your strategy should be after registration for push from the MDK application to also set these values to your backend mapping table that will maintain the backend user to the device and mobile user. Then when your backend event happens that needs to notify users you can lookup the necessary values from the mapping table and send the push notifications from the backend to Mobile Services