我遇到aws推送通知问题,
我只在iPad上收到此错误,但它在iPhone上工作
Error occurred: [Error Domain=com.amazonaws.AWSSNSErrorDomain Code=0 "(null)" UserInfo={Type=Sender, Message=The security token included in the request is expired, __text=(
"\n ",
"\n ",
"\n ",
"\n "
), Code=ExpiredToken}]
AWSSNS *sns = [[AWSSNS new] initWithConfiguration:configuration];
AWSSNSCreatePlatformEndpointInput *endpointRequest = [AWSSNSCreatePlatformEndpointInput new];
endpointRequest.platformApplicationArn = myArn;
endpointRequest.token = strdeviceToken;
__block AWSSNSSubscribeInput *subscribeRequest;
__block AppDelegate *blocksafeSelf = self;
[[[sns createPlatformEndpoint:endpointRequest] continueWithSuccessBlock:^id(BFTask *task)
{
AWSSNSCreateEndpointResponse *response = task.result;
subscribeRequest = [AWSSNSSubscribeInput new];
subscribeRequest.topicArn = @"arn:aws:sns:us-east-1:005";
subscribeRequest.endpoint = response.endpointArn;
subscribeRequest.protocol = @"application";
endPoint = response.endpointArn;
[blocksafeSelf CallNotificationSettings:endPoint];
//[blocksafeSelf CallNewsNotificationSettings:endPoint];
// [blocksafeSelf CallSportsNotificationSettings:endPoint];
//[blocksafeSelf CallEntertainmentNotificationSettings:endPoint];
return [sns subscribe:subscribeRequest];
}] continueWithBlock:^id(BFTask *task)
{
if (task.cancelled) {
NSLog(@"Task cancelled");
}
else if (task.error) {
NSLog(@"Error occurred: [%@]", task.error);
}
else {
NSLog(@"Success %@",task.result);
}
return nil;
}];
我在iPhone中获得成功回应
任何想法?