

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 行動推送 API 動作
<a name="mobile-push-api"></a>

若要使用 Amazon SNS 行動裝置推送 API，您必須先滿足推送通知服務 (例如 Apple Push Notification (APN) 和 Firebase Cloud Messaging (FCM)) 的事前準備。如需有關先決條件的詳細資訊，請參閱 [Amazon SNS 使用者通知的先決條件](sns-prerequisites-for-mobile-push-notifications.md)。

 若要使用 API 傳送推送通知訊息到行動應用程式和裝置，首先您必須使用會傳回 `PlatformApplicationArn` 屬性的 `CreatePlatformApplication` 動作。`PlatformApplicationArn` 屬性然後會被傳回 `EndpointArn` 屬性的 `CreatePlatformEndpoint` 使用。然後您可以使用 `EndpointArn` 屬性搭配 `Publish` 動作來傳送通知訊息到行動應用程式和裝置，或者您可以對於訂閱主題使用 `EndpointArn` 屬性和 `Subscribe` 動作。如需詳細資訊，請參閱[使用 Amazon SNS 設定推送通知](sns-mobile-application-as-subscriber.md#sns-user-notifications-process-overview)。

Amazon SNS 行動推送 API 如下所示：

`[CreatePlatformApplication](https://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformApplication.html)`  
針對裝置和行動應用程式可能註冊的其中一個支援的推送通知服務 (例如 APN 和 FCM)，建立平台應用程式物件。傳回 `CreatePlatformEndpoint` 動作所使用的 `PlatformApplicationArn` 屬性。

`[CreatePlatformEndpoint](https://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformEndpoint.html)`  
為裝置和行動應用程式的其中一個支援的推送通知服務建立端點。`CreatePlatformEndpoint` 使用從 `CreatePlatformApplication` 動作傳回的 `PlatformApplicationArn` 屬性。使用 `CreatePlatformEndpoint` 時傳回之 `EndpointArn` 屬性會搭配使用 `Publish` 動作，來傳送通知訊息到行動應用程式和裝置。

`[CreateTopic](https://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html)`  
建立可發佈訊息的主題。

`[DeleteEndpoint](https://docs.aws.amazon.com/sns/latest/api/API_DeleteEndpoint.html)`  
為裝置和行動應用程式的其中一個支援的推送通知服務刪除端點。

`[DeletePlatformApplication](https://docs.aws.amazon.com/sns/latest/api/API_DeletePlatformApplication.html)`  
刪除平台應用程式物件

`[DeleteTopic](https://docs.aws.amazon.com/sns/latest/api/API_DeleteTopic.html)`  
刪除主題及其所有訂閱。

`[GetEndpointAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetEndpointAttributes.html)`  
為裝置和行動應用程式擷取端點屬性。

`[GetPlatformApplicationAttributes](https://docs.aws.amazon.com/sns/latest/api/API_GetPlatformApplicationAttributes.html)`  
擷取平台應用程式物件的屬性。

`[ListEndpointsByPlatformApplication](https://docs.aws.amazon.com/sns/latest/api/API_ListEndpointsByPlatformApplication.html)`  
列出支援的推送通知服務中裝置和行動應用程式的端點和端點屬性。

`[ListPlatformApplications](https://docs.aws.amazon.com/sns/latest/api/API_ListPlatformApplications.html)`  
列出支援的推送通知服務的平台應用程式物件。

`[Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html)`  
傳送通知訊息到所有主題的訂閱端點。

`[SetEndpointAttributes](https://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html)`  
為裝置和行動應用程式設定端點的屬性。

`[SetPlatformApplicationAttributes](https://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html)`  
設定平台應用程式物件的屬性。

`[Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html)`  
透過傳送端點確認訊息，來準備訂閱端點。若要實際建立訂閱，端點擁有者必須使用字符從確認訊息呼叫 ConfirmSubscription 動作。

`[Unsubscribe](https://docs.aws.amazon.com/sns/latest/api/API_Unsubscribe.html)`  
刪除訂閱。