Register an item context action for an existing account that's registered with the BlackBerry Hub.


int uds_register_item_context_action(uds_context_t handle,
                                     uds_account_key_t accountId,
                                     const uds_item_action_data_t *pItem)


BlackBerry 10.2.0



The handle that's associated with your app's registration with the BlackBerry Hub.


The account key of the existing account to register the item context action for, as a uds_account_key_t.


The item context action to register. This item action is represented by a uds_item_action_data_t and contains all of the information that's required to display and invoke the action based on the state of an inbox list item in the BlackBerry Hub.


libunifieddatasourcec (For the qcc command, use the -l unifieddatasourcec option to link against this library)


This function registers an item context action for an existing account that was added to the BlackBerry Hub using uds_account_added(). If the item context action is registered successfully (that is, this function returns UDS_SUCCESS), the data from the action populates the context menu when an inbox list item is selected in the account view in the BlackBerry Hub.

Here's an example of how to create and populate a globally defined item context action, and then register the action with the BlackBerry Hub:

 typedef enum{
     ReadAction = 0x01<<0,
     UnreadReadAction = 0x01<<1,
     AcceptAction = 0x01<<2
 // The udsHandle variable below is the handle that your app obtains by
 // calling uds_init()
 int retVal = -1;
 uds_item_action_data_t *item_action = uds_item_action_data_create();
 uds_item_action_data_set_title(item_action,"Accept Request");
 if (UDS_SUCCESS!= (retVal = uds_register_item_context_action(udsHandle, 1 ,
   printf("uds_register_item_context_action failed with error %d\n", retVal);


UDS_SUCCESS if the item context action was registered successfully, or a non-zero error code on failure. See uds_error_code_t or errno.h for details.

Last modified: 2015-01-22

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus