Directed Text
Learn how to send and receive direct text messages to other users.
Read time 1 minuteLast updated 7 months ago
Vivox provides directed text by using a similar process to what is used for group text. You can add players to existing text sessions, and you can send text messages directly to any user who is signed in, independent of being in a channel with them.
Use directed text for short user-to-user messages (sometimes called whispers or private/direct messages), or to implement invite to channel capabilities.
Use the request to send a text message to another user.
vx_req_account_send_msgUsing is not mandatory. However, in testing scenarios where there could be more than one user signed into the local SDK messaging each other, guarantees the availability of receiving a directed message.
vx_evt_presence_updatedvx_evt_presence_updatedThe following code displays an example of this process:
. . .vx_req_account_send_msg *req;vx_req_account_send_msg_create(&req);req->connector_handle = vx_strdup("c1");req->account_handle = vx_strdup(".issuer-w-dev.mytestaccountname.");req->user_uri = vx_strdup("sip:theotheruser@vd1.vivox.com");req->message_body = vx_strdup("Hey there buddy!");vx_issue_request3(&req->base, &request_count);. . .
When a user-to-user text message is available, the event is sent to the game.
vx_evt_user_to_user_messageThe following code displays an example of this action:
void HandleUserToUserMessageEvent(vx_evt_user_to_user_message *evt){ printf("Message from %s: %s\n", evt->from_uri, evt->message_body);}