AWS SDK for Java 1.x 已於 2025 年 12 月 31 日end-of-support。我們建議您遷移至 AWS SDK for Java 2.x,以繼續接收新功能、可用性改善和安全性更新。
本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
在 中更新頻道 Amazon Pinpoint
頻道定義您可以傳送訊息的平台類型。此範例說明如何使用 APNs 頻道來傳送訊息。
更新頻道
Amazon Pinpoint 透過提供您要更新之頻道類型的應用程式 ID 和請求物件,在 中啟用頻道。此範例會更新需要 APNSChannelRequest 物件的 APNs 頻道。在 UpdateApnsChannelRequest 中設定這些物件,並將該物件傳遞至 AmazonPinpointClient 的 updateApnsChannel方法。
匯入
import com.amazonaws.services.pinpoint.AmazonPinpoint; import com.amazonaws.services.pinpoint.AmazonPinpointClientBuilder; import com.amazonaws.services.pinpoint.model.APNSChannelRequest; import com.amazonaws.services.pinpoint.model.APNSChannelResponse; import com.amazonaws.services.pinpoint.model.GetApnsChannelRequest; import com.amazonaws.services.pinpoint.model.GetApnsChannelResult; import com.amazonaws.services.pinpoint.model.UpdateApnsChannelRequest; import com.amazonaws.services.pinpoint.model.UpdateApnsChannelResult;
Code
APNSChannelRequest request = new APNSChannelRequest() .withEnabled(enabled); UpdateApnsChannelRequest updateRequest = new UpdateApnsChannelRequest() .withAPNSChannelRequest(request) .withApplicationId(appId); UpdateApnsChannelResult result = client.updateApnsChannel(updateRequest);
請參閱 GitHub 上的完整範例
詳細資訊
-
Amazon Pinpoint 《 使用者指南》中的Amazon Pinpoint 頻道
-
Amazon Pinpoint API 參考中的 ADM 頻道
-
Amazon Pinpoint API 參考中的 APNs 頻道
-
API 參考中的 APNs 沙盒頻道 Amazon Pinpoint
-
API 參考中的 APNs VoIP 頻道 Amazon Pinpoint
-
API 參考中的 APNs VoIP 沙盒頻道 Amazon Pinpoint
-
Amazon Pinpoint API 參考中的百度頻道
-
Amazon Pinpoint API 參考中的電子郵件管道
-
Amazon Pinpoint API 參考中的 GCM 頻道
-
Amazon Pinpoint API 參考中的簡訊管道