> ## 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.

# PFAccountManagementServerLinkNintendoSwitchDeviceIdAsync

> 將 Nintendo Switch 裝置識別碼連結至指定 PlayFab 玩家帳戶的伺服器 API，讓裝置可在日後的工作階段中登入。

將 NintendoSwitchDeviceId 連結至使用者的 PlayFab 帳戶

## 語法

```cpp theme={null}
HRESULT PFAccountManagementServerLinkNintendoSwitchDeviceIdAsync(  
    PFEntityHandle titleEntityHandle,  
    const PFAccountManagementServerLinkNintendoSwitchDeviceIdRequest* request,  
    XAsyncBlock* async  
)  
```

### 參數

**`titleEntityHandle`**   PFEntityHandle

使用 PFAuthenticationGetEntityWithSecretKeyAsync 取得之遊戲 Entity 的 PFEntityHandle。

**`request`**   [PFAccountManagementServerLinkNintendoSwitchDeviceIdRequest\*](/zh-TW/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementserverlinknintendoswitchdeviceidrequest)

已填入的要求物件。

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

用於非同步作業的 XAsyncBlock。

### 傳回值

類型：HRESULT

此 API 作業的結果代碼。

## 備註

此 API 適用於 Win32、Linux 和 macOS。另請參閱 ServerUnlinkNintendoSwitchDeviceIdAsync。呼叫 XAsyncGetStatus 以取得作業的狀態。如果服務呼叫失敗，非同步結果將為 E\_PF\_LINKED\_ACCOUNT\_ALREADY\_CLAIMED 或任何全域 PlayFab 服務錯誤。如需錯誤處理的詳細資訊，請參閱文件頁面「Handling PlayFab Errors」。

## 需求

**標頭：** PFAccountManagement.h

## 另請參閱

[PFAccountManagement 成員](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members)


## Related topics

- [PFAccountManagementServerLinkNintendoSwitchDeviceIdRequest](/zh-TW/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementserverlinknintendoswitchdeviceidrequest.md)
- [PFAccountManagementServerUnlinkNintendoSwitchDeviceIdAsync](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementserverunlinknintendoswitchdeviceidasync.md)
- [PFAccountManagementClientLinkNintendoSwitchDeviceIdAsync](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientlinknintendoswitchdeviceidasync.md)
- [PFAccountManagementClientLinkNintendoSwitchDeviceIdRequest](/zh-TW/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementclientlinknintendoswitchdeviceidrequest.md)
- [PFAccountManagementClientUnlinkNintendoSwitchDeviceIdAsync](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientunlinknintendoswitchdeviceidasync.md)
