uds_register_account_action()

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

Synopsis:

int uds_register_account_action(uds_context_t handle,
                                uds_account_key_t accountId,
                                const uds_account_action_data_t *pAccountAction)

Since:

BlackBerry 10.2.0

Arguments:

handle

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

accountId

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

pAccountAction

The account action to register. This account action is represented by a uds_account_action_data_t and contains all of the information that's required to register and display the action in the appropriate account view in the BlackBerry Hub.

Library:

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

Description:

This function registers an account action for an existing account that was added to the BlackBerry Hub using uds_account_added(). If the account action is registered successfully (that is, this function returns UDS_SUCCESS), the account action appears in the associated account view in the BlackBerry Hub.

Here's an example of how to create and populate an account action, and then register the action with the BlackBerry Hub:

 // The udsHandle variable below is the handle that your app obtains by
 // calling uds_init()
 int retVal = -1;
 uds_account_action_data_t account_action = uds_account_action_data_create();
 uds_account_action_data_set_action(account_action,"bb.action.STATUS");
 uds_account_action_data_set_target(account_action,"UDSTestApp");
 uds_account_action_data_set_type(account_action,"");
 uds_account_action_data_set_title(account_action,"Status");
 uds_account_action_data_set_image_source(account_action,"ic_status.png");
 uds_account_action_data_set_mime_type(account_action,"text/plain");
 uds_account_action_data_set_placement(account_action,UDS_PLACEMENT_BAR);
 if (UDS_SUCCESS!= (retVal = uds_register_account_action(udsHandle, 1 ,
                                                         account_action)))
 {
     printf("uds_register_account_action failed with error %d\n", retVal);
 }

Returns:

UDS_SUCCESS if the account 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