How to register a userId to Bluemix Push Notifications services?

前端 未结 1 565
夕颜
夕颜 2021-01-15 05:54

the REST API documentation for Bluemix Push Notification services states that the possible push notification targets are deviceIds, platforms, tagNames and userIds.

相关标签:
1条回答
  • 2021-01-15 06:21

    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.

    0 讨论(0)
提交回复
热议问题