- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在使用 Amazon SNS向我的 iOS 应用程序发送推送通知。
无论出于何种原因,我的端点有时似乎会设置为“false”——即使我知道它们是有效的端点(因为重新启用它们然后会向设备发送新的推送通知)。 There's a similar Stack Overflow question here - but no technical answer as to how to resolve the issue.
所以:我需要弄清楚如何将端点设置为已启用
。
有 only sparse Amazon documentation对于如何执行此操作,所以我做知道的是我需要使用属性字典中的“启用”键/值。
我的代码片段如下所示:
AmazonSNSClient *sns = [AmazonClientManager sns];
SNSCreatePlatformEndpointRequest *endpointPutRequest = [SNSCreatePlatformEndpointRequest new];
endpointPutRequest.platformApplicationArn = kBXTAWSAppARN;
endpointPutRequest.token = deviceToken;
[endpointPutRequest setAttributesValue:@"True" forKey:@"Enabled"];
SNSCreatePlatformEndpointResponse *endpointResponse = [sns createPlatformEndpoint:endpointPutRequest];
除了单行代码,它工作得很好,它将属性值“Enabled”设置为“true”。我已经尝试了所有这些组合:
[endpointPutRequest setAttributesValue:@"true" forKey:@"Enabled"];
[endpointPutRequest setAttributesValue:@"true" forKey:@"enabled"];
[endpointPutRequest setAttributesValue:@"True" forKey:@"Enabled"];
...但它们都不起作用。编写这行代码的正确方法是什么?我应该以某种方式使用 BOOL 吗?整数?
最佳答案
到目前为止,我发现在某些情况下,即使端点和 token 正确,端点属性也会变为 false
如果您已经使用 Production APNS 证书创建了亚马逊 sns 应用程序,但您尝试使用 SANDBOX APNS(即开发 APNS)注册您的设备,那么它将得到 false
当用户在手机设置中关闭通知时,苹果 APNS 会禁用影响亚马逊 sns 的标志。每当用户再次启用通知时,您已将 token 重新发送到亚马逊以设置属性为真,即需要在客户端处理
当用户删除/卸载应用时
关于ios - 如何使用 iOS SDK 重新启用 Amazon SNS 终端节点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23700649/
我创建了一个 SNS 主题,我想用 filter policy 订阅它。匹配嵌套属性。例如,给出这样的消息: { "foo": { "bar": "baz" }, "quux":
我将 AWS EventBridge 配置为将事件发布到 SNS 目标。当收到事件时,SNS 目标永远不会被触发,并且没有任何 SNS 订阅者会收到该事件。 如果我将其他目标添加到 EventBrid
我将 AWS EventBridge 配置为将事件发布到 SNS 目标。当收到事件时,SNS 目标永远不会被触发,并且没有任何 SNS 订阅者会收到该事件。 如果我将其他目标添加到 EventBrid
我正在尝试一次将推送通知发送到多个设备。为此,我正在执行以下操作: 列表项 创建话题 订阅我想要的所有设备到该主题 向主题 发布消息 我正在尝试将自定义 JSON 发送到我的应用程序。内容是: {"A
我正在处理从 AWS SNS 向一组用户发送电子邮件通知的任务。我创建了一个主题并通过将其发送到我的电子邮件来测试通知。但现在我想将这些电子邮件通知发送到至少包含 10 15 个电子邮件 ID 的组。
我正在尝试将 AWS EventBridge 与 SNS 目标一起使用,并且我已经获得了使用输入转换器发送基本消息 SNS 的基本集成。但是,我希望能够设置 SNS 消息属性(用于订阅过滤)并理想地将
我有一个场景,我在 SNS 主题中发布一条消息,然后将此消息发送到 SQS 队列。我想要的是每次向订阅者发送消息时都登录 SNS(例如我的 sqs 队列)。 SNS 是 AWS 的一个被动组件,日志不
我们正在建立一个微服务,用户可以通过他们的电子邮件地址自行注册。本微服务将发送一封验证邮件,用户可以通过该邮件验证注册的电子邮件地址。 我们计划使用 Amazon SNS 发送此电子邮件。然而,我们看
我一直在关注 Amazon 的以下博客文章(场景 3:从另一个账户中的 Amazon S3 存储桶通知触发 Lambda 函数),了解授权 Lambda 函数用于各种用途。我想设置一个 Lambda
我需要同时向可能有数千个设备端点发布唯一消息。 消息是唯一的,所以我不能将端点分组到主题中...... 虽然我找不到任何文档,但似乎 SNS 限制为只有 10 个并发 API 发布请求。 10个以上并
我有一个 AWS lambda 函数,它接收大量电子邮件地址并将它们提交给 SES 进行发送。该功能是通过 SNS 订阅调用的。当消息的电子邮件数组大小较小时,它可以很好地工作,但是当消息的电子邮件数
我正在使用 AWS SNS 用于发送警报电子邮件。现在邮件内容真的是长因此我希望将其作为 发送文件附件而不是将其作为电子邮件内容发送。这可以使用 SNS 完成吗? 最佳答案 不,不能。 SNS FAQ
将主题附加到 SNS 应用程序的“端点已更新”可配置主题时,我遇到了一些意外行为。根据 AWS 文档 SNS Application Events ,当平台端点已更新为禁用或 token 已更改时,我
我在 CDK 中遇到了这个问题。我有一个由 SNS 主题触发的 lambda(从 S3 存储桶接收事件),但现在它在传递到 SNS 主题的每条消息上执行。我希望 Lambda 仅在特定的存储桶名称、文
我想知道禁用的 EndpointARN (Enabled:false) 是否会被 AWS SNS 自动删除,还是需要由我删除? 最佳答案 Amazon SNS 服务不会自动删除禁用的端点。 您可以使用
我在 CDK 中遇到了这个问题。我有一个由 SNS 主题触发的 lambda(从 S3 存储桶接收事件),但现在它在传递到 SNS 主题的每条消息上执行。我希望 Lambda 仅在特定的存储桶名称、文
我正在使用以下函数定义: missing: handler: functions/eeegMissing.handler events: - sns: arn:aws:sn
我有 2 个 AWS CDK 应用程序在单独的 AWS 账户中运行,我正在尝试添加 CDK 以在一个 AWS 账户中获取 lambda 以订阅另一个 AWS 账户中的通知。 我尝试在 lambda 帐
首先我发现了同样的问题here ,但它不起作用...也许 AWS SDK 更改或其他原因,我不知道为什么...我想从我的 iOS 应用程序订阅 SNS 主题。我正在尝试使用该答案中的代码来完成此操作,
在设备注册远程通知后(在application:didRegisterForRemoteNotificationsWithDeviceToken)我是: 使用设备的 token 创建平台端点。 订阅主
我是一名优秀的程序员,十分优秀!