-
Notifications
You must be signed in to change notification settings - Fork 0
Friends
Because playing with friends is even better and thrilling. List all user's friends and create an healthy competition environment to keep them all engaged.
The following function is provided for fetching friends:
This function queries an array of user_id
represent the a user's friends (further information can be queried using the GameJolt_User_FetchWithUserID).
This is an asynchronous function that will trigger either the callback_success
method (if task is successful) or the callback_failed
method (if task fails).
Syntax:
GameJolt_Friends([callback_success], [callback_failed])
Argument | Type | Description |
---|---|---|
callback_success | function | The callback function executed if the request succeeds (array of user_id is passed as argument) ✴️ OPTIONAL |
callback_failed | function | The callback function executed if the request fails (error message is passed as argument) ✴️ OPTIONAL |
Returns:
N/A
Example:
GameJolt_Friends(
function(array)
{
// If the array has at least one entry
if (array_length(array) > 1)
{
GameJolt_User_FetchWithUserID(array[0], function(data) {
show_message_async(data);
})
}
}
);
In the code sample above we perform an action to retrieve an array with the user_id
s of all the logged user friends. We then provide a method that will fetch the user information for the first user id in the returned array (using the GameJolt_User_FetchWithUserID function), printing out the result when finished.
YoYoGames 2023