

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

# 在 Amazon Chime SDK 訊息中接收推送通知
<a name="receive-notifications"></a>

除了頻道訊息推送通知標題和內文之外，Amazon Chime SDK 還在資料承載中包含頻道訊息 ID 和頻道 ARN。您可以使用該資訊來載入完整的頻道訊息。

下列範例顯示典型的推送通知承載。

```
{
    "pinpoint.openApp=true",
    "pinpoint.notification.title={{PushNotificationTitle}}",
    "pinpoint.notification.body={{PushNotificationBody}}",
    "pinpoint.campaign.campaign_id=_DIRECT",
    "pinpoint.notification.silentPush=0",
    "pinpoint.jsonBody="{
        "chime.message_id":"{{ChannelMessageId}}",
        "chime.channel_arn":"{{ChannelARN}}"
    }
}
```

## 停用或篩選推送通知回條
<a name="disable-filter-receipt"></a>

Amazon Chime SDK 提供多種選項，允許應用程式執行個體使用者控制他們是否想要接收推送通知。

**停用所有推送通知**  
 應用程式執行個體使用者可以呼叫 `AllowMessages` 並將 屬性[https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_UpdateAppInstanceUserEndpoint.html](https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_UpdateAppInstanceUserEndpoint.html)設定為 ，以完全停用推送通知`NONE`。

**停用頻道的推送通知**  
應用程式執行個體使用者可以在 PushNotification 偏好設定欄位中呼叫 [https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_PutChannelMembershipPreferences.html](https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_PutChannelMembershipPreferences.html)以停用特定頻道的`NONE`推送通知。 **PushNotification ** 

**篩選頻道的推送通知**  
應用程式執行個體使用者可以設定篩選規則，以便他們只能使用 [https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_PutChannelMembershipPreferences.html](https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_PutChannelMembershipPreferences.html) API 接收特定的推送通知。如需詳細資訊，請參閱 [使用篩選規則來篩選 Amazon Chime SDK 訊息的訊息](filter-msgs.md)。