An application developer intends to deliver a notification to a particular user with ID ‘TestUser". Which server call should the application developer use to deliver the notification?
A.
var notification.target.userlds = [‘TestUser’]; sendMessage(‘TestApplication’,notification);
B.
var notification = {} notification.target = {} notification.target.userlds = [TestUser]; sendMessage(TestApplication,notification);
C.
var notification = {} notification.message.alert = "notification text"; notification.target.userlds = [TestUser]; sendMessage(TestApplication,notification);
D.
var notification = {} notification.message = {} notification.message.alert = "notification text"; notification.target = {} notification.target.userlds = [TestUser];
Suggested Answer:D🗳️
You can send a unicast notification to a particular user in the following way: * Use the sendMessage method of the WL.Server class. The applicationId and notificationOptions parameters are mandatory. * The userId(s) as an array in the notificationOptions.target.userIds object. Example: function sendMessage(msg){ var notificationOptions = {}; notificationOptions.type = 0; notificationOptions.message = {}; notificationOptions.message.alert = msg; notificationOptions.target = {}; References: https://www.ibm.com/support/knowledgecenter/SSHS8R_6.3.0/com.ibm.worklight.dev.doc/devref/c_send_push_notifications.html http://stackoverflow.com/ questions/27701167/how-to-trigger-an-alert-once-receiving-push-notifications-using-broadcast-notifi
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Comments