2

Bluemix 推送通知服务的 REST API 文档指出,可能的推送通知目标是 deviceIds、platforms、tagNames 和 userIds。

我不明白您如何为设备注册用户 ID?我没有看到任何似乎在其输入中采用 userId 的 REST 服务......

谢谢你的帮助,

塞巴斯蒂安

4

1 回答 1

1

使用POST 设备调用注册设备时,您可以从 REST API 设置一个 deviceId。

DeviceRegResponseModeluserId (string, optional): The user identifier for the the device registration

因此,基本上要设置一个 userId,您只需要将其添加到您在通过 REST API 注册设备时发送的 json 中。因此,只需修改 REST API 为主体提供的示例:

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

然后,您可以在您的正文中使用POST 消息调用,将该消息发送到使用 userId“John”注册的所有设备。"userId": "John"target

希望这可以帮助。

于 2015-12-03T15:35:51.443 回答