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

# PFPushNotificationsServerSendPushNotificationFromTemplateAsync

> 向特定用户发送 iOS/Android 推送通知模板（如果该用户的设备已在 PlayFab 中配置了推送通知）。如果用户同时关联了 Android 和 iOS 设备，两者都将收到通知。

向特定用户发送 iOS/Android 推送通知模板（如果该用户的设备已在 PlayFab 中配置了推送通知）。如果用户同时关联了 Android 和 iOS 设备，两者都将收到通知。

## 语法

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

### 参数

**`titleEntityHandle`**   PFEntityHandle

使用 PFAuthenticationGetEntityWithSecretKeyAsync 获取的标题实体的 PFEntityHandle。

**`request`**   [PFPushNotificationsSendPushNotificationFromTemplateRequest\*](/services/playfab/api-references/c/pfpushnotificationstypes/structs/pfpushnotificationssendpushnotificationfromtemplaterequest)

已填充的请求对象。

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

用于异步操作的 XAsyncBlock。

### 返回值

类型：HRESULT

此 API 操作的结果代码。

## 备注

此 API 可在 Windows、Linux 和 macOS 上使用。调用 XAsyncGetStatus 以获取操作状态。如果服务调用不成功，异步结果将为 E\_PF\_PUSH\_NOT\_ENABLED\_FOR\_ACCOUNT、E\_PF\_PUSH\_NOTIFICATION\_TEMPLATE\_NOT\_FOUND、E\_PF\_PUSH\_SERVICE\_ERROR 或任何全局 PlayFab 服务错误。有关错误处理的更多详细信息，请参阅文档页“Handling PlayFab Errors”。

## 要求

**头文件：** PFPushNotifications.h

## 另请参阅

[PFPushNotifications 成员](/services/playfab/api-references/c/pfpushnotifications/pfpushnotifications_members)


## Related topics

- [服务 C API 概览 - PFPushNotifications.h](/zh-CN/services/playfab/api-references/c/pfpushnotifications/pfpushnotifications_members.md)
- [PFPushNotificationsSendPushNotificationFromTemplateRequest](/zh-CN/services/playfab/api-references/c/pfpushnotificationstypes/structs/pfpushnotificationssendpushnotificationfromtemplaterequest.md)
- [PFPushNotificationsServerSendPushNotificationAsync](/zh-CN/services/playfab/api-references/c/pfpushnotifications/functions/pfpushnotificationsserversendpushnotificationasync.md)
- [PFPushNotificationsSendPushNotificationRequest](/zh-CN/services/playfab/api-references/c/pfpushnotificationstypes/structs/pfpushnotificationssendpushnotificationrequest.md)
- [PFPlatformSpecificClientRegisterForIOSPushNotificationAsync](/zh-CN/services/playfab/api-references/c/pfplatformspecific/functions/pfplatformspecificclientregisterforiospushnotificationasync.md)
