navigator_invoke_viewer_relay()

The use of viewers has been deprecated - use applications or cards as invocation targets instead.

Synopsis:

#include <bps/navigator_invoke.h>
 
BPS_API int navigator_invoke_viewer_relay(const char *window_id,
                                          const char *message_name,
                                          const char *data,
                                          const char *id,
                                          bool is_response) BPS_DEPRECATED

Since:

BlackBerry 10.0.0

Arguments:

window_id

The window ID associated with the viewer. The window_id member must not be NULL.

message_name

The name or title of the message you want to send. The message_name member must not be NULL.

data

The data you want to send the viewer relay message target. The data member can be NULL.

id

The ID of the message. This is used to correlate the request with the peer's response. If you don't set this member, the sender doesn't receive a response to the sent message. Use the navigator_event_get_id() function to retrieve the id from the NAVIGATOR_INVOKE_VIEWER_RELAY_RESULT response event.

is_response

The request/response type of the message. If this member is false, the message type is a request, otherwise it's a response. The request messages are received by peer through NAVIGATOR_INVOKE_VIEWER_RELAY events. The responses from the peer are received through NAVIGATOR_INVOKE_VIEWER_RELAY_RESULT events.

Library:

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

Description:

Deprecated:

The use of viewers has been deprecated - use applications or cards as invocation targets instead.

The navigator_invoke_viewer_relay() function enables two way communication between the parent application and the viewer in the form of request/response messages. Both the viewer and the parent application use this function to send the data to each other.

If you call this function, the target application or viewer receives the NAVIGATOR_INVOKE_VIEWER_RELAY request event, and can retrieve the sent data. The sender gets a NAVIGATOR_INVOKE_VIEWER_RELAY_RESULT response event as a response to the sent message.

If you encounter an error in processing the message delivery, we recommend that you call the navigator_event_get_err() function to determine the nature of the error. The possible errors are:
  • INVALID_WINDOW_ID
  • INVALID_MESSAGE

Returns:

BPS_SUCCESS upon success, BPS_FAILURE with errno set otherwise.