xboxlive_set_rich_presence


Description

This function will set the rich presence string for the given user. A Rich Presence string shows a user's in-game activity after the name of the game that the user is playing, separated by a hyphen. This string is displayed under a player's Gamertag in the "Friends & Clubs" list as well as in the player's Xbox Live user profile.

When using this function you need to supply the User ID pointer for the user, and then you can flag the user as currently active in the game or not (using true/false). If set to false, then the rich presence string will be appended with "/afk" or something appropriate. The next argument is the rich presence string ID to show, and then finally you can (optionally) supply a service_config_id string. Note that this is an optional argument since if you have called xboxlive_stats_setup() you don't need to pass the service_config_id here.

For more information on rich presence and how to set up the strings to use in the partner center, please see the following Microsoft documentation:

IMPORTANT! This function is only valid when exporting using the UWP target for the Xbox One and it requires you to have checked the Enable XBox Live option in the UWP Game Options.


Syntax:

xboxlive_set_rich_presence(user_id, is_user_active, rich_presence_string, [service_config_id])

Argument Description
user_id The ID pointer of the user to check.
is_user_active Flag the user as active or not.
rich_presence_string The rich presence string ID to use (as defined in the Partner Center - max 50 characters)
service_config_id [OPTIONAL] This is the config_id string for the game.


Returns:

N/A


Example:

var pad_uid = xboxlive_user_for_pad(0);
xboxlive_set_rich_presence(pad_uid, true, "Playing_Challenge");

The above code gets the user ID pointer for the user assigned to the gamepad [0] slot, and then sets the rich presence string for that user.