Skip to main content

Query Channel Friend List (QueryFriends)

[Player Network SDK & MSDK] Get the list of channel friends or in-game friends for a player.

info
  • Currently, the client only supports fetching friends from the Epic channel. Other channels require obtaining the list via the backend.
  • [Player Network SDK only] Facebook channel friends can be obtained via a backend interface for third-party channel co-playing friends list: Facebook Friends

Supported Platforms

Supports Android, iOS, Windows platform.
note

MSDK currently does not support Windows

Function Definition

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

Input Parameters

ParametersTypeDescription
pageintWhich page of friends to fetch
countintNumber of friends per page
isInGameboolWhether They Are In-Game Friends
true indicates an in-game friend; false indicates otherwise
channelstringChannel definition
Example: "Facebook"
QQ and WeChat currently only offer backend API.This is to prevent unauthorized access to the relationship chain.
subChannelstringSub-channel
extraJsonstringExtended interface, passing data transparently

Callback Handling

The callback handling interface is GUAQuereyFriendObserver.The callback data structure is GUAFriendResult.

The callback event is QuereyFriendEvents. The callback ID is GUA_FRIEND_QUERY_FRIENDS.

Code Example

UnionAdapterAPI.GetFriendService().QueryFriends();