Search code examples
notificationsibm-mobilefirst

IBM MobileFirst v7.1 push notification tag


We plan to use MobileFirst Push Notification service.

Here's our plan :

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

So, if we want to push particular user, just need to know what UserID is.

Question:

  1. Is this plan is best practices for sending particular user by using mobileFirst tag?

  2. How large tags size can we put in "tagNames"?

var notification = {};

notification.type = 0;

notification.message = {};

notification.message.alert = "notification text";

notification.target = {};

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

API doc


Solution

  • You could do as described, however, if you are going to be implementing userIds as a "tag", you may want to consider simply authenticating the user with their userId to the MF server.

    You can then send unicast notifications using the userIds array method, which prevents you from having to subscribe/unsubscribe tags containing a userId.