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

# PFPushNotificationsServerSendPushNotificationAsync

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

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

## 语法

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

### 参数

**`titleEntityHandle`**   PFEntityHandle

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

**`request`**   [PFPushNotificationsSendPushNotificationRequest\*](https://docs.xbox.com/zh-CN/services/playfab/api-references/c/pfpushnotificationstypes/structs/pfpushnotificationssendpushnotificationrequest.md)

已填充的请求对象。

**`async`**   XAsyncBlock\*\
*Inout*

用于异步操作的 XAsyncBlock。

### 返回值

类型：HRESULT

此 API 操作的结果代码。

## 备注

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

## 要求

**头文件：** PFPushNotifications.h

## 另请参阅

[PFPushNotifications 成员](https://docs.xbox.com/zh-CN/services/playfab/api-references/c/pfpushnotifications/pfpushnotifications_members.md)


## Related topics

- [服务 C API 概览 - PFPushNotifications.h](https://docs.xbox.com/zh-CN/services/playfab/api-references/c/pfpushnotifications/pfpushnotifications_members.md)
- [Send Push Notification](https://docs.xbox.com/api-reference/account-management/send-push-notification.md)
- [Send Push Notification From Template](https://docs.xbox.com/api-reference/account-management/send-push-notification-from-template.md)
- [ServerSendPushNotificationFromTemplateAsync](https://docs.xbox.com/zh-CN/services/playfab/api-references/c/pfpushnotifications/functions/pfpushnotificationsserversendpushnotificationfromtemplateasync.md)
- [PFPushNotificationsSendPushNotificationRequest](https://docs.xbox.com/zh-CN/services/playfab/api-references/c/pfpushnotificationstypes/structs/pfpushnotificationssendpushnotificationrequest.md)
