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

# 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 取得之 Title 實體的 PFEntityHandle。

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

已填入的要求物件。

**`async`**   XAsyncBlock\*<br />*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 成員](/services/playfab/api-references/c/pfpushnotifications/pfpushnotifications_members)


## Related topics

- [服務 C API 概觀 - PFPushNotifications.h](/zh-TW/services/playfab/api-references/c/pfpushnotifications/pfpushnotifications_members.md)
- [PFPushNotificationsServerSendPushNotificationFromTemplateAsync](/zh-TW/services/playfab/api-references/c/pfpushnotifications/functions/pfpushnotificationsserversendpushnotificationfromtemplateasync.md)
- [PFPushNotificationsSendPushNotificationRequest](/zh-TW/services/playfab/api-references/c/pfpushnotificationstypes/structs/pfpushnotificationssendpushnotificationrequest.md)
- [PFPushNotificationsSendPushNotificationFromTemplateRequest](/zh-TW/services/playfab/api-references/c/pfpushnotificationstypes/structs/pfpushnotificationssendpushnotificationfromtemplaterequest.md)
- [PFPlatformSpecificClientRegisterForIOSPushNotificationAsync](/zh-TW/services/playfab/api-references/c/pfplatformspecific/functions/pfplatformspecificclientregisterforiospushnotificationasync.md)
