Kom*_*ari 5 parse-error amazon-web-services ios parse-platform
当我在解析迁移到AWS + MongoLab后从iOS App发送推送通知时,我收到错误 - 未经授权:需要主密钥(代码:0,版本:1.12.0),我如何解决它,以及我使用iOS解析代码用于通过Mobile Hub发送通知和AWS SNS服务的消息.
在解析迁移到AWS之前,推送通知发送完美,在迁移解析后使用此链接推送到aws https://mobile.awsblog.com/post/Tx3NE69QDHI7LJK/Migrating-from-Parse-Push-to-Amazon-SNS,我是得到此错误 - 未经授权:需要主密钥(代码:0,版本:1.12.0)即使我也使用一个信号而不是SNS来消除此错误,仍然我得到相同的错误,它在我测试时工作正常使用上述链接的步骤-4通知.下面是我在应用程序中使用的iOS解析代码 -
PFQuery*queryInstallation = [PFInstallation query]; [queryInstallation whereKey:kESInstallationUserKey matchesQuery:query];
PFPush *push = [[PFPush alloc] init];
[push setQuery:queryInstallation];
NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:
message, @"alert",
@"Increment", @"badge",
@"homerun.caf", @"sound",
@"m", @"p",
nil];
[push setData:data];
[push sendPushInBackgroundWithBlock:^(BOOL succeeded, NSError *error)
{
if (error != nil)
{
NSLog(@"SendPushNotification send error.");
}
}];
Run Code Online (Sandbox Code Playgroud)
我主要使用客户端代码,但在某些方面也使用云端代码.
| 归档时间: |
|
| 查看次数: |
967 次 |
| 最近记录: |