Skip to main content

QueryFriends

AndroidiOSWindows
If you were looking for the method for use with Unreal Engine, see QueryFriends for Unreal Engine SDK.

Obtains the channel friend list or the in-game friend list of the player.

info

Currently, Player Network SDK supports obtaining friend lists for Discord, Epic, Kakao, Switch, and Xbox Series X|S.
For Facebook, Garena, QQ, Steam, WeChat, and VK, friend lists can be obtained through the friend_list backend API.

ChannelsAndroidiOSWindowsConsole
DiscordSupportedSupportedNot supportedNot supported
EpicNot supportedNot supportedSupportedNot supported
KakaoSupportedSupportedNot supportedNot supported
SwitchNot supportedNot supportedNot supportedSupported
Xbox Series X|SNot supportedNot supportedNot supportedSupported

Function definition

public static void QueryFriends(int page = 0, int count = 0, bool isInGame = true, string channel = "", string extraJson = "{}");

Input parameters

ParameterTypeDescription
pageintThe specified page of a friend to pull.
countintThe number of friends per page.
isInGameboolWhether the friend is an in-game friend.
true: In-game friend
false: Not in-game friend
channelstringChannel definition
Example: "Facebook"
QQ Mobile and WeChat currently only provide backend APIs. This is to prevent unauthorized access to the relationship chain.
extraJsonstringThe extended field to pass additional data.

Observers

The callback processing interface is FriendResultObserver. The callback data structure is FriendResult.

The callback methodID is INTL_FRIEND_QUERY_FRIENDS.

Code sample

 INTLAPI.QueryFriends(1, 10, true, INTLChannel.Facebook);