> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PFFriendsClientAddFriendAsync

> 指定された一意識別子との一致に基づいて、PlayFab ユーザーをローカル ユーザーのフレンド リストに追加します。少なくとも 1 つが指定されている必要があります。

指定された一意識別子との一致に基づいて、PlayFab ユーザーをローカル ユーザーのフレンド リストに追加します。FriendPlayFabId、FriendUsername、FriendEmail、FriendTitleDisplayName のうち少なくとも 1 つを初期化する必要があります。

## 構文

```cpp theme={null}
HRESULT PFFriendsClientAddFriendAsync(  
    PFEntityHandle entityHandle,  
    const PFFriendsClientAddFriendRequest* request,  
    XAsyncBlock* async  
)  
```

### パラメーター

**`entityHandle`**   PFEntityHandle

認証に使用する PFEntityHandle。

**`request`**   [PFFriendsClientAddFriendRequest\*](/services/playfab/api-references/c/pffriendstypes/structs/pffriendsclientaddfriendrequest)

値が設定されたリクエスト オブジェクト。

**`async`**   XAsyncBlock\*<br />*Inout*

非同期操作用の XAsyncBlock。

### 戻り値

型: HRESULT

この API 操作の結果コード。

## 解説

この API はすべてのプラットフォームで利用できます。ClientGetFriendsListAsync、ClientSetFriendTagsAsync も参照してください。非同期タスクが完了したら、[PFFriendsClientAddFriendGetResult](/services/playfab/api-references/c/pffriends/functions/pffriendsclientaddfriendgetresult) を呼び出して結果を取得します。

## 要件

**ヘッダー:** PFFriends.h

## 関連項目

[PFFriends のメンバー](/services/playfab/api-references/c/pffriends/pffriends_members)


## Related topics

- [PFFriendsClientAddFriendGetResult](/ja-jp/services/playfab/api-references/c/pffriends/functions/pffriendsclientaddfriendgetresult.md)
- [Services C API overview - PFFriends.h](/ja-jp/services/playfab/api-references/c/pffriends/pffriends_members.md)
- [PFFriendsClientGetFriendsListAsync](/ja-jp/services/playfab/api-references/c/pffriends/functions/pffriendsclientgetfriendslistasync.md)
- [PFFriendsClientRemoveFriendAsync](/ja-jp/services/playfab/api-references/c/pffriends/functions/pffriendsclientremovefriendasync.md)
- [PFFriendsClientAddFriendRequest](/ja-jp/services/playfab/api-references/c/pffriendstypes/structs/pffriendsclientaddfriendrequest.md)
