如何将 userId 注册到 Bluemix 推送通知服务?
How to register a userId to Bluemix Push Notifications services?
Bluemix 推送通知服务的 REST API 文档指出,可能的推送通知目标是设备 ID、平台、标签名称和用户 ID。
我不明白你是如何为设备注册 userId 的?我没有看到任何似乎在其输入中采用 userId 的 REST 服务...
感谢您的帮助,
塞巴斯蒂安
当使用 POST devices call 注册设备时,您可以从 REST API 设置一个 deviceId。
在DeviceRegResponseModel
是userId (string, optional): The user identifier for the the device registration
所以基本上要设置一个用户 ID,您只需将其添加到您通过 REST API 注册设备时发送的 json。因此,只需修改 REST API 为主体提供的示例:
{
"deviceId": "TestDeviceId",
"platform": "A",
"token": "************",
"userId": "John"
}
然后您可以在 target
正文中使用带有 "userId": "John"
的 POST messages call 将该消息发送到使用用户 ID“John”注册的所有设备。
希望对您有所帮助。
Bluemix 推送通知服务的 REST API 文档指出,可能的推送通知目标是设备 ID、平台、标签名称和用户 ID。
我不明白你是如何为设备注册 userId 的?我没有看到任何似乎在其输入中采用 userId 的 REST 服务...
感谢您的帮助,
塞巴斯蒂安
当使用 POST devices call 注册设备时,您可以从 REST API 设置一个 deviceId。
在DeviceRegResponseModel
是userId (string, optional): The user identifier for the the device registration
所以基本上要设置一个用户 ID,您只需将其添加到您通过 REST API 注册设备时发送的 json。因此,只需修改 REST API 为主体提供的示例:
{
"deviceId": "TestDeviceId",
"platform": "A",
"token": "************",
"userId": "John"
}
然后您可以在 target
正文中使用带有 "userId": "John"
的 POST messages call 将该消息发送到使用用户 ID“John”注册的所有设备。
希望对您有所帮助。