如何在Bluemix Push Notifications服务中注册userId? [英] How to register a userId to Bluemix Push Notifications services?

查看:82
本文介绍了如何在Bluemix Push Notifications服务中注册userId?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我不明白您如何注册设备的userId?我看不到任何看起来在其输入中带有userId的REST服务...

I don't understand how you register a userId for a device ? I don't see any REST service that seem to take a userId in its inputs...

感谢您的帮助,

塞巴斯蒂安

推荐答案

使用DeviceRegResponseModel中是userId (string, optional): The user identifier for the the device registration

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

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"
}

然后,您可以将 POST消息调用与<target正文中的c2>,以将该消息发送到所有以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".

希望这会有所帮助.

这篇关于如何在Bluemix Push Notifications服务中注册userId?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆