IBM MobileFirst v7.1 推送通知标签

IBM MobileFirst v7.1 push notification tag

我们计划使用 MobileFirst 推送通知服务。

这是我们的计划:

All user subscribe self unique tag. This tag might be UserID

所以,如果我们想推送特定用户,只需要知道 UserID 是什么。

问题:

  1. 这个计划是使用 mobileFirst 标签发送特定用户的最佳实践吗?

  2. 我们可以在 "tagNames" 中放入多大的标签?

var notification = {};

notification.type = 0;

notification.message = {};

notification.message.alert = "notification text";

notification.target = {};

notification.target.tagNames = ['Tag1','Tag2'];

API doc

您可以按照说明进行操作,但是,如果您打算将 userId 实现为 "tag",您可能需要考虑简单地使用 MF 服务器的 userId 对用户进行身份验证。

然后您可以使用 userIds 数组方法发送单播通知,这样您就不必 subscribe/unsubscribe 包含 userId 的标签。