How to register a userId to Bluemix Push Notifications services?

笑着哭i 提交于 2019-12-01 10:47:24

There is a deviceId that you can set from the REST API when using the POST devices call to register a device.

In the DeviceRegResponseModel is userId (string, optional): The user identifier for the the device registration

So essentially to set a userId you'll just want to add that to the json you send when registering a device through the REST API. So just modifying the example the REST API gives for the body:

{
  "deviceId": "TestDeviceId",
  "platform": "A",
  "token": "************",
  "userId": "John"
}

And then you can use the POST messages call with "userId": "John" in your target body to send that message to all devices registered with the userId "John".

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!