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

# PFAuthenticationServerLoginWithIOSDeviceIDAsync

> 使用 iOS 设备标识符为用户登录，并返回可在后续需要已验证用户的 API 调用中使用的会话标识符

使用 iOS 设备标识符为用户登录，并返回可在后续需要已验证用户的 API 调用中使用的会话标识符

## 语法

```cpp theme={null}
HRESULT PFAuthenticationServerLoginWithIOSDeviceIDAsync(  
    PFServiceConfigHandle serviceConfigHandle,  
    const char* secretKey,  
    const PFAuthenticationServerLoginWithIOSDeviceIDRequest* request,  
    XAsyncBlock* async  
)  
```

### 参数

**`serviceConfigHandle`**   PFServiceConfigHandle

从 PFServiceConfigCreateHandle 调用返回的 PFServiceConfigHandle。

**`secretKey`**   char\*<br />*In\_z*

用于对服务请求进行身份验证的游戏密钥。

**`request`**   [PFAuthenticationServerLoginWithIOSDeviceIDRequest\*](/zh-CN/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationserverloginwithiosdeviceidrequest)

已填充的请求对象。

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

用于异步操作的 XAsyncBlock。

### 返回值

类型：HRESULT

此 API 操作的结果代码。

## 备注

此 API 在 Windows 上可用。在 iOS 设备上，必须使用 identifierForVendor ([https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice\_Class/index.html#](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#) // apple\_ref/occ/instp/UIDevice/identifierForVendor) 作为 DeviceId，因为自 iOS 5 起 UIDevice uniqueIdentifier 已被弃用，且将 advertisingIdentifier 用于此目的将导致无法通过 Apple 的认证流程。如果这是用户首次使用该 iOS 设备登录且 CreateAccount 设为 true，将创建一个新的 PlayFab 帐户并链接到该供应商特定的 iOS 设备 ID。在这种情况下，该 PlayFab 帐户将没有关联的电子邮件或用户名。否则，如果没有 PlayFab 帐户链接到该 iOS 设备，将返回相应的错误，以便游戏引导用户创建 PlayFab 帐户。异步任务完成后，调用 [PFAuthenticationServerLoginWithIOSDeviceIDGetResult](/zh-CN/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithiosdeviceidgetresult) 以获取结果。

## 要求

**头文件：** PFAuthentication.h

## 另请参阅

[PFAuthentication 成员](/zh-CN/services/playfab/api-references/c/pfauthentication/pfauthentication_members)


## Related topics

- [PFAuthenticationServerLoginWithIOSDeviceIDGetResultSize](/zh-CN/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithiosdeviceidgetresultsize.md)
- [PFAuthenticationServerLoginWithIOSDeviceIDGetResult](/zh-CN/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithiosdeviceidgetresult.md)
- [PFAuthenticationServerLoginWithAndroidDeviceIDAsync](/zh-CN/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithandroiddeviceidasync.md)
- [PFAuthenticationServerLoginWithAndroidDeviceIDGetResult](/zh-CN/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithandroiddeviceidgetresult.md)
- [PFAuthenticationServerLoginWithAndroidDeviceIDGetResultSize](/zh-CN/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationserverloginwithandroiddeviceidgetresultsize.md)
