exam questions

Exam C5050-408 All Questions

View all questions & answers for the C5050-408 exam

Exam C5050-408 topic 1 question 44 discussion

Actual exam question from IBM's C5050-408
Question #: 44
Topic #: 1
[All C5050-408 Questions]

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];
Show Suggested Answer Hide Answer
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

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Currently there are no comments in this discussion, be the first to comment!
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...