- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
使用适用于 iOS v2.0.8 的 AWS 开发工具包
快速提问:
当我不知道此端点的 arn 时,如何[snsClient deleteEndpoint:request]
?我有 deviceToken。
详细信息:
当我尝试为我的 iPhone 创建端点时,我收到错误 Token Reason: Endpoint arn:aws:sns:...c6 already exists with the same Token, but different attributes
:
// Async call to create the platform endpoint
[[[_awsSnsClient createPlatformEndpoint:request] continueWithSuccessBlock:^id(BFTask *task) {
// success
_awsPlatformEndpoint = task.result; // Save off the endpoint data
[self awsUsubscribeAllSubscriptions];
return nil;
}] continueWithBlock:^id(BFTask *task) {
if (task.error) {
// failed with error
ALog(@"Error: Code:%li localizedDesc:%@ Exception:%@", (long)task.error.code, task.error.localizedDescription, task.exception);
if(task.error.code == 7) {
// delete offending endpoint and create it again?
}
}
return nil;
}];
当我创建端点时,我没有设置 attributes
,我确实根据可以更改的客户端数据设置了 customUserData
。在SDK docs对于 customUserData
,它表示:要与端点关联的任意用户数据。 Amazon SNS 不使用此数据。数据必须为UTF-8格式且小于2KB。
当我从 SNS 控制台删除端点时,我可以获得一个新的端点。那么当我不知道这个端点的 arn 时,我该如何删除端点呢?我可以在 AWS 日志记录中看到 arn,但在 BFTask* 错误对象中看不到。
我在 19551067 看到了 ruby 解决方案,但我看不到读取消息的方法,ruby 示例从异常中读取消息,在我的例子中是 task.exception == nil。我从 AWS 收到详细日志记录:
使用 AWS 日志记录:
2014-10-01 06:48:54.489 myApp[1665:1345740] AWSiOSSDKv2 [Verbose] AWSURLResponseSerialization.m line:244 | -[AWSXMLResponseSerializer responseObjectForResponse:originalRequest:currentRequest:data:error:] | Response body: [<ErrorResponse xmlns="http://sns.amazonaws.com/doc/2010-03-31/">
<Error>
<Type>Sender</Type>
<Code>InvalidParameter</Code>
<Message>Invalid parameter: Token Reason: Endpoint arn:aws:sns:us-west-2:245211809793:endpoint/APNS_SANDBOX/myApp-Dev/7bxxx-xxxx-xxxx-xxxc6 already exists with the same Token, but different attributes.</Message>
</Error>
<RequestId>d874ac10-e6de-5a4d-805e-e0b6ee58e5b7</RequestId>
</ErrorResponse>
]
我可以从 (BFTask* task).error 中得到什么:
2014-10-01 06:48:54.494 myApp[1665:1345740] __46-[AppDelegate_Shared awsStartWithDeviceToken:]_block_invoke1279 [Line 3558] Error:
Code:7
localizedDesc:The operation couldn’t be completed. (com.amazonaws.AWSSNSErrorDomain error 7.)
Exception:(null)
** 更新 2014-10-01 **
我的开发版 iPad 在更新到 iOS 8.0.2 后就开始这样做了。我确实将版本号添加到 customUserData
- 但 Amazon SNS 不使用此字段...对吗?
** 更新 2014-01-01 19:06 GMT-07:00 **
将 task.error.userInfo
添加到错误 block 。当出现这种情况时,我将解析消息并删除端点。 AWSSNSCreatePlatformEndpointInput
中的一个选项可以覆盖此错误、更新端点并返回端点;)
谢谢!
控制台现在有:
2014-10-01 18:58:50.836 iFlightBag[1862:1493821] __46-[AppDelegate_Shared awsStartWithDeviceToken:]_block_invoke1281 [Line 3559] Error:
Code:7
localDesc:The operation couldn’t be completed. (com.amazonaws.AWSSNSErrorDomain error 7.)
Exception:(null)
userInfo:{
Code = InvalidParameter;
Message = "Invalid parameter: Token Reason: Endpoint arn:aws:sns:us-west-2:245211809793:endpoint/APNS_SANDBOX/LevelFlightMobile-Dev/7b70d2c4-846e-3afd-a1ba-eedaa00f7ac6 already exists with the same Token, but different attributes.";
Type = Sender;
"__text" = (
"\n ",
"\n ",
"\n ",
"\n "
);
}
最佳答案
task.error
的 userInfo
属性应该包含错误 XML 的字典表示。
关于ios - AWS SNS 错误参数无效 : Token Reason: Endpoint xxx already exists with the same Token, 但属性不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26144103/
我从我的服务器获取此 IP,例如: "/177.127.101.68:53964" "/201.80.15.100:54263" "/177.67.38.54:51309" 我需要它就像“177.12
终端抛出此错误意味着什么以及如何解决它? packet_write_wait: Connection to xxx.xxx.xxx.xxx: Broken pipe 这是今天刚刚发生的事情。正常工作一
这应该是非常简单的,但我不能让它为我的生活工作。我只是想远程连接到我的MySQL服务器。。连接方式:。运作良好,但正在尝试:。失败,并显示以下错误:。错误1130(00000):不允许主机‘xxx.x
正在尝试将坞站映像推送到私有坞站存储库。但收到如下错误:“拨号tcp:lookup xxx.xxx:没有这样的主机”。我已正确登录到存储库,并且构建成功。。以下命令用于将映像推送到私有repo:sud
这个问题已经有答案了: Android 8: Cleartext HTTP traffic not permitted (37 个回答) 已关闭 3 年前。 这是 list 文件
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: A comprehensive regex for phone number validation 什么是正
尝试将 docker 镜像推送到私有(private) docker 存储库。但出现类似错误:“dial tcp:lookup xxx.xxx.xxx.xxx: no such host”。我已正确登
我搜索了 StackOverflow,并在尝试打开引用不同项目中的 UserControl 的表单时发现了类似的问题。 我明白 To prevent possible data loss before
我收到的错误是 com.sun.xml.ws.client.ClientTransportException: HTTP transport error: java.io.IOException: H
我需要用 preg_match 检查输入,它必须是这种格式:xxx.xxx.xxx block 的数量可以变化......这些都是有效输入的例子: 001 00a.00a 0fg.001 aaa.aa
在所有构建过程完成且没有任何错误后,我遇到了失败。 我不知道为什么会出现以下错误。 即使所有测试均已成功完成,此错误仍将作业状态标记为失败。致命:来自 socaautovm1.xxx.local/19
我有一个单独托管的 Postgres 数据库,我正试图将其与我的 Phoenix 应用程序一起使用。我的 prod 配置是: config :my_app, MyApp.Repo, adapter
我尝试使用 terraform 在 Azure 中创建负载均衡器,但收到此错误: Error: creating/updating Load Balancer "lbclassic" (Resourc
Java中是否有一个类可以让您将“102203345.32”之类的数字格式化为“102.203.345,32”并返回字符串类型? 我想获得一个字符串,其中千位由“.”分隔。小数点之间用逗号“,”分隔。
大家好,我已经通过大量在线编码来获取我的 android 手机 IP 地址大多数都以结尾 if (!inetAddress.isLoopbackAddress()) {
首先,我知道 this question .由于我既没有使用 maven 也没有使用 jenkins,因此无法使用提供的解决方案。 在使用 sonar-runner 分析我的项目时,我收到以下警告:
我的脚本有些问题。它应该通过代理打开一个网站,但我总是遇到这个错误,我正在尝试使用几个代理... 它会是什么? Traceback (most recent call last): File "C
我正在使用远程数据库在 PHP 下开发 Web 应用程序,其中我有以下测试脚本: try { $dbh = new PDO('mysql:host=XXX.XXX.XXX.XXX;dbname
我正在尝试使用 php-facebook-sdk 并借助 curl Facebook API 创建广告。 我已经使用 curl 上传了我的视频,它返回了一个 ID。现在,该视频 ID 将用于添加广告,
首先,这是一个编程问题,因为我正在尝试设置与生产服务器一起运行的测试/QA 服务器。 其次,是的,我应该将其发布在 Serverfault 上,但我尝试使用三个不同的 OpenID 提供程序登录,每次
我是一名优秀的程序员,十分优秀!