Skip to main content
Version: Next

Facebook Friends

This feature allows retrieving the player's Facebook friends who also play the game.

Configuration is done via the Settings Inspector in Unity.

Configuration is applied automatically at build time for each platform.

Platform markersโ€‹

The following markers are used to indicate platform availability of parameters and features:

  • (no marker) โ€” Shared parameter or feature
  • ๐Ÿ โ€” iOS-specific parameter or feature
  • ๐Ÿค– โ€” Android-specific parameter or feature
  • โš ๏ธ โ€” Not implemented in the Unity plugin yet

Ask your release manager for the required parameters before configuring the SDK.

Configurationโ€‹

This feature requires Facebook Authorization to be set up.

Usageโ€‹

Get Social Friendsโ€‹

To request the user's friend list:

P101XP.GetInstance().GetSocialFriends();

The result is delivered through SocialFriendsEvent.

Eventsโ€‹

Always subscribe before making the request:

private void SocialFriendsHandler(FriendsContainer friendsContainer)
{
}

P101XP.GetInstance().SocialFriendsEvent += SocialFriendsHandler;

FriendsContainerโ€‹

public class FriendsContainer
{
public List<SocialFriend> friends;
public string error;
}

Fieldsโ€‹

FieldTypeDescription
friendsList<SocialFriend>List of friends playing this game
errorstringError message or null if request succeeded

SocialFriendโ€‹

public class SocialFriend
{
public int level;
public long mobileId;
public string name;
public string pictureUrl;
public string socialNetId;
}

Fieldsโ€‹

FieldTypeDescription
levelintPlayer's in-game level
mobileIdlong101XP mobile ID
namestringFriend's display name
pictureUrlstringURL to the friendโ€™s social avatar
socialNetIdstringSocial network user ID