在 Amazon Chime SDK 消息传递中接收推送通知
除了频道消息推送通知的标头和正文外,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
" } }
禁用或筛选推送通知回执
Amazon Chime SDK 提供了多个选项,允许应用程序实例用户控制他们是否希望接收推送通知。
禁用所有推送通知
应用程序实例用户可以调用 UpdateAppInstanceUserEndpoint 并将 AllowMessages
属性设置为 NONE
,从而完全禁用推送通知。
禁用频道的推送通知
应用程序实例用户可以通过在 PushNotification Preferences 字段中向 NONE
调用 PutChannelMembershipPreferences 来禁用特定频道的推送通知。
筛选频道的推送通知
应用程序实例用户可以设置过滤规则,让自己在使用 PutChannelMembershipPreferences API 时只能接收特定的推送通知。有关更多信息,请参阅在 Amazon Chime SDK 消息传递中使用筛选规则来筛选消息。