End point does not exists - AWS SNS - ios

I'm getting "Endpoint does not exists" when I'm trying to register for topic from my ios project. Inside info.plist file, I set my SNSPlatformApplicationARN to the app I created in SNS console. I've been scratching my heads of to resolve this issue. I appreciate any help. This is full error :
016-12-11 12:52:05.534 MiGPShttps://forums.aws.amazon.com/ AWSiOSSDK v2.4.11 https://forums.aws.amazon.com/ AWSURLSessionManager.m line:212 | -https://forums.aws.amazon.com/ | Session task failed with error: Error Domain=NSPOSIXErrorDomain Code=54 "Connection reset by peer" UserInfo={_kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=54}
2016-12-11 12:52:05.820 MiGPShttps://forums.aws.amazon.com/ AWSiOSSDK v2.4.11 https://forums.aws.amazon.com/ AWSURLSessionManager.m line:553 | -https://forums.aws.amazon.com/ | Response headers:
{
"Content-Length" = 262;
"Content-Type" = "text/xml";
Date = "Sun, 11 Dec 2016 17:52:05 GMT";
"x-amzn-RequestId" = "xxxx";
}
2016-12-11 12:52:05.820 MiGPShttps://forums.aws.amazon.com/ AWSiOSSDK v2.4.11 https://forums.aws.amazon.com/ AWSURLResponseSerialization.m line:240 | -https://forums.aws.amazon.com/ | Response body:
<ErrorResponse xmlns="http://sns.amazonaws.com/doc/2010-03-31/">
<Error>
<Type>Sender</Type>
<Code>NotFound</Code>
<Message>Endpoint does not exist</Message>
</Error>
<RequestId>xxxx-xxx-xxx</RequestId>
</ErrorResponse>

Related

Pintest iOS SDK - 401 Authorization error on login

I have been able to authenticate with the Pinterest API on both the javascript and Android SDK. On iOS, I've triple-checked all of my settings to make sure I've configured everything according to the documentation.
However, when I log in through iOS, I am taken to the Pinterest app to authorize and all looks good. However, when Pinterest passes me back to my app, I am getting the following login error:
Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: unauthorized (401)" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x17403dea0> { URL: https://api.pinterest.com/v1/oauth/inspect?access_token=AYalMni-yTq5Y0UihwETrFxZpzL5FK2tXvfmkbhDyJ_OP8BGeQAAAAA&token=AYalMni-yTq5Y0UihwETrFxZpzL5FK2tXvfmkbhDyJ_OP8BGeQAAAAA } { status code: 401, headers {
Age = 0;
"Cache-Control" = private;
Connection = "keep-alive";
"Content-Length" = 177;
"Content-Type" = "application/json";
Date = "Mon, 20 Mar 2017 19:21:15 GMT";
"Pinterest-Generated-By" = "devplatform-devapi-prod-0a01239b";
"Pinterest-Version" = 918ef75;
"X-Content-Type-Options" = nosniff;
"X-Pinterest-RID" = 280542321780;
} }, NSErrorFailingURLKey=https://api.pinterest.com/v1/oauth/inspect?access_token=AYalMni-yTq5Y0UihwETrFxZpzL5FK2tXvfmkbhDyJ_OP8BGeQAAAAA&token=AYalMni-yTq5Y0UihwETrFxZpzL5FK2tXvfmkbhDyJ_OP8BGeQAAAAA, com.alamofire.serialization.response.error.data=<7b227374 61747573 223a2022 6661696c 75726522 2c202263 6f646522 3a20332c 2022686f 7374223a 20226465 76706c61 74666f72 6d2d6465 76617069 2d70726f 642d3061 30313233 3962222c 20226765 6e657261 7465645f 6174223a 20224d6f 6e2c2032 30204d61 72203230 31372031 393a3231 3a313520 2b303030 30222c20 226d6573 73616765 223a2022 41757468 6f72697a 6174696f 6e206661 696c6564 2e222c20 22646174 61223a20 6e756c6c 7d>, NSLocalizedDescription=Request failed: unauthorized (401)}
I tried taking the access token referred to in the error response and using the token debugger on the Pinterest developer site to check it, but when I did so I got the message "An error occurred. Please try again."
So, I'm stumped. It seems to me that the access token that's being generated on iOS login is being seen as invalid by Pinterest, but I don't know how to fix that.
Do you have any thoughts on what can be done to resolve this?

Alamofire 3.5.1: download stopped when in airplane mode

We are experiencing an issue downloading file, when we activate airplane mode.
We are using the following Manager configuration:
let configuration = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier(self.sessionIdentifier)
configuration.HTTPMaximumConnectionsPerHost = 1
let manager = Alamofire.Manager(configuration: configuration)
The expected behaviour is that when you activate the airplane mode, the response handler is not called and the download is still active and waiting for the internet connection to be active again. But the response is called and we get the following information:
Error:
Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL}
Data:
nil
Response:
status code: 200, headers {
"Accept-Ranges" = bytes;
"Cache-Control" = "max-age=604800";
"Content-Length" = 138310665;
"Content-Type" = "video/mp4";
Date = "Thu, 20 Oct 2016 13:09:19 GMT";
Etag = "\"3168233889\"";
Expires = "Thu, 27 Oct 2016 13:09:19 GMT";
"Last-Modified" = "Fri, 25 Sep 2015 09:38:30 GMT";
Server = "ECAcc (fcn/40BD)";
"X-Cache" = HIT;
And the original request
Notice that the error does not contain, even resume data, which I think it should.
And also this is not the case when we test it in the simulator and stop the internet connection.
Any help will be much appreciated!

Swift / iOS: Error to post image to Pinterest

Im getting this error while posting image to Pinterest
Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: unauthorized (401)" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x144603bd0> { URL: https://api.pinterest.com/v1/pins/ } { status code: 401, headers {
"Accept-Ranges" = bytes;
"Cache-Control" = private;
Connection = close;
"Content-Length" = 177;
"Content-Type" = "application/json";
Date = "Sun, 10 Jul 2016 19:38:00 GMT";
"Pinterest-Generated-By" = "devplatform-devapi-prod-de3d740a";
"Pinterest-Version" = bcdafd3;
Server = nginx;
"X-Content-Type-Options" = nosniff;
"X-Pinterest-RID" = 480720869025;
"X-Varnish" = 2958547338;
} }, NSErrorFailingURLKey=https://api.pinterest.com/v1/pins/, com.alamofire.serialization.response.error.data=<7b227374 61747573 223a2022 6661696c 75726522 2c202263 6f646522 3a20332c 2022686f 7374223a 20226465 76706c61 74666f72 6d2d6465 76617069 2d70726f 642d6465 33643734 3061222c 20226765 6e657261 7465645f 6174223a 20225375 6e2c2031 30204a75 6c203230 31362031 393a3338 3a303020 2b303030 30222c20 226d6573 73616765 223a2022 41757468 6f72697a 6174696f 6e206661 696c6564 2e222c20 22646174 61223a20 6e756c6c 7d>, NSLocalizedDescription=Request failed: unauthorized (401)}
Here is my code:
PDKClient.sharedInstance().createPinWithImage(image, link: NSURL(string:"http://domain"), onBoard: "MyBoard", description: caption, progress: {percent in
print(percent)
}, withSuccess: {PDKResponseObject in
print("ok")
print(PDKResponseObject.boards())
}, andFailure: {error in
print(error)
})
Error 401 means one of the following.
1.Authentication failed.
2.Authorization failed.
3.You are not permitted to access that resource.
Double check your permissions, check your session token expired or not.
So I think that there is nothing wrong with your code, or the request. It's something with the permissions you have in your Pinterest app.
Try changing the request URL from http to https.
Check the parameters you sending to Pinterest, check whether the parameter names are correct or not, as specified in Pinterest documentation. Also those parameters has the proper type of data, I mean do not pass String in the place of Integer value.
.

AWS S3 File Download with Objective-C Successful Then Unsuccessful

I have a strange problem using AWS S3. The first time I call the code, files are downloaded from the S3 service as expected. The next time I call the code to download additional files, it hangs.
I am using version 2.1.2 of the AWS iOS SDK. I have downloaded and installed the SDK using cocoapods. I have read other threads on Stack Overflow and they do not address this issue.
The code:
static AWSStaticCredentialsProvider *credentialsProvider;
static AWSServiceConfiguration *configuration;
static AWSS3 *transferManager;
//This code is run when the object is instantiated
-(id)init
{
if ( self = [super init] ) {
credentialsProvider = [AWSStaticCredentialsProvider credentialsWithAccessKey:#“ACCESS KEY" secretKey:#“SECRET"];
configuration = [AWSServiceConfiguration configurationWithRegion:AWSRegionUSEast1 credentialsProvider:credentialsProvider];
[AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;
transferManager = [[AWSS3 alloc] initWithConfiguration:configuration];
}
return self;
}
-(UIImage *) getImageData:(NSString *)imageName
{
AWSS3 *transferManager = [[AWSS3 alloc] initWithConfiguration:configuration];
AWSS3GetObjectRequest *getImageRequest = [AWSS3GetObjectRequest new];
getImageRequest.bucket = #"quizontapimages/quizimages";
getImageRequest.key = imageName;
getImageRequest.key = [getImageRequest.key stringByAppendingString:#".png"];
BFTask *downloadTask1 = [[transferManager getObject:getImageRequest] continueWithExecutor:[BFExecutor mainThreadExecutor] withBlock:^id(BFTask *task) {
if(task.error)
{
NSLog(#"Error: %#",task.error);
}
else
{
NSData *data = [task.result body];
image = [UIImage imageWithData:data];
}
return nil;
}];
[downloadTask1 waitUntilFinished];
return image;
}
I have also tried commenting out the first line of getImageData method to use the initialized transferManager with the same results.
When I use AWS verbose logging on the successful download I get the following information:
2015-06-11 16:12:51.199 QuizOnTap[7362:538728] AWSiOSSDKv2 [Debug] AWSSignature.m line:241 | -[AWSSignatureV4Signer signS3RequestV4:] | Canonical request: [GET
/quizontapimages/quizimages/WABD_QSI_333x118.png
content-type:binary/octet-stream
host:s3.amazonaws.com
user-agent:aws-sdk-iOS/2.0.17 iPhone-OS/8.3 en_US
x-amz-content-sha256:*some key*
x-amz-date:20150611T211251Z
content-type;host;user-agent;x-amz-content-sha256;x-amz-date
*some key*]
2015-06-11 16:12:51.199 QuizOnTap[7362:538728] AWSiOSSDKv2 [Debug] AWSSignature.m line:248 | -[AWSSignatureV4Signer signS3RequestV4:] | AWS4 String to Sign: [AWS4-HMAC-SHA256
20150611T211251Z
20150611/us-east-1/s3/aws4_request
*some key*]
2015-06-11 16:12:51.493 QuizOnTap[7362:539182] AWSiOSSDKv2 [Debug] AWSURLResponseSerialization.m line:258 | -[AWSXMLResponseSerializer responseObjectForResponse:originalRequest:currentRequest:data:error:] | Response header: [{
"Accept-Ranges" = bytes;
"Content-Length" = 15947;
"Content-Type" = "image/png";
Date = "Thu, 11 Jun 2015 21:12:52 GMT";
Etag = "\"ff690cf7807b538278fc1590ce446785\"";
"Last-Modified" = "Sun, 31 May 2015 16:14:42 GMT";
Server = AmazonS3;
"x-amz-id-2" = "QIu6OWhmuO53z6Qgo+Q/4gsN4dQbyCAPbwS4QyDm/pmmSRXj8M5O4x5GoXMQq/rgSh0AKqt0uVk=";
"x-amz-request-id" = E0DB22A10F901130;
}]
2015-06-11 16:12:51.493 QuizOnTap[7362:539182] AWSiOSSDKv2 [Verbose] AWSURLResponseSerialization.m line:263 | -[AWSXMLResponseSerializer responseObjectForResponse:originalRequest:currentRequest:data:error:] | Response body: [(null)]
Later on in the process I call the same identical code that never returns from [downloadTask1 waitUntilFinished];. Below is the AWS verbose log for that transaction. Notice the long running operation warning as well.
2015-06-11 16:14:03.075 QuizOnTap[7362:538689] AWSiOSSDKv2 [Debug] AWSSignature.m line:241 | -[AWSSignatureV4Signer signS3RequestV4:] | Canonical request: [GET
/quizontapimages/quizimages/neat_square_1.png
content-type:binary/octet-stream
host:s3.amazonaws.com
user-agent:aws-sdk-iOS/2.0.17 iPhone-OS/8.3 en_US
x-amz-content-sha256:*some key*
x-amz-date:20150611T211403Z
content-type;host;user-agent;x-amz-content-sha256;x-amz-date
*some key*]
2015-06-11 16:14:03.075 QuizOnTap[7362:538689] AWSiOSSDKv2 [Debug] AWSSignature.m line:248 | -[AWSSignatureV4Signer signS3RequestV4:] | AWS4 String to Sign: [AWS4-HMAC-SHA256
20150611T211403Z
20150611/us-east-1/s3/aws4_request
*some key*]
2015-06-11 16:14:03.076 QuizOnTap[7362:538689] Warning: A long-running operation is being executed on the main thread.
Break on warnBlockingOperationOnMainThread() to debug.
2015-06-11 16:14:03.396 QuizOnTap[7362:540085] AWSiOSSDKv2 [Debug] AWSURLResponseSerialization.m line:258 | -[AWSXMLResponseSerializer responseObjectForResponse:originalRequest:currentRequest:data:error:] | Response header: [{
"Accept-Ranges" = bytes;
"Content-Length" = 4998;
"Content-Type" = "image/png";
Date = "Thu, 11 Jun 2015 21:14:04 GMT";
Etag = "\"7b27202a6560ed99277acebf2235ba89\"";
"Last-Modified" = "Fri, 22 May 2015 15:16:13 GMT";
Server = AmazonS3;
"x-amz-id-2" = "5TxaPQy8jblFr8qVXfiSg3pK0EfOqSdEWdykE0kfRKUdrfxvmxvYvzf0uXGYiXXliAG/DbM55tM=";
"x-amz-request-id" = 9F7BC6AC5494D285;
}]
2015-06-11 16:14:03.396 QuizOnTap[7362:540085] AWSiOSSDKv2 [Verbose] AWSURLResponseSerialization.m line:263 | -[AWSXMLResponseSerializer responseObjectForResponse:originalRequest:currentRequest:data:error:] | Response body: [(null)]
You are not retaining a strong reference to the transferManager object in - getImageData:. Please remember that - getObject: is an asynchronous method, and it returns immediately. You need to retain a strong reference to the service client until the request finishes processing.
If you use the AWS Mobile SDK for iOS 2.1.2, Xcode should give you a compiler warning for the use of - initWithConfiguration:. The method was deprecated to mitigate the misuse of the API such as this case. Please use + defaultS3TransferManager or + S3TransferManagerForKey: to retrieve the AWSS3TransferManager object.
(Also, the log indicates you are using 2.0.17 instead of 2.1.2.)

iOS App Signup Error

I receive this error when I tried to signup an account with the app im building. May I know what does this error means? Thank you!
BaseNetworkManager.m:164 Error Domain=AFNetworkingErrorDomain Code=-1011
"Expected status code in (200-299), got 500" UserInfo=0x16d30560
{NSLocalizedRecoverySuggestion=meta http-equiv="refresh" content="0;
url =websitelink.error.html"
AFNetworkingOperationFailingURLRequestErrorKey=NSMutableURLRequest: 0x16670d80> { URL: mywebsite/users.json }, NSErrorFailingURLKey=h mywebsite.com/users.json, NSLocalizedDescription=Expected status code in (200-299), got 500, AFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x1669fe20> { URL: mywebsite.com/users.json } { status code: 500, headers {
Connection = "keep-alive";
"Content-Length" = 690;
"Content-Type" = "text/html; charset=utf-8";
Date = "Fri, 01 May 2015 12:37:44 GMT";
Server = Cowboy;
Status = "500 Internal Server Error";
Via = "1.1 vegur";
"X-Rack-Cache" = "invalidate, pass";
"X-Request-Id" = "tyud";
"X-Runtime" = "5.087065"; } }}
2015-05-01 20:37:45.002 appname[1677:60b] <BaseNetworkManager.m:165> (null)
The server is telling you
500 Internal Server Error
this means that the server has a problem that is not your fault. (unless you are the one who is responsible for the server.)
HTTP 200..299 means "ok"
HTTP 300..399 means "look somewhere else"
HTTP 400..499 means "there is a problem with your request." for example 404=file not found, 403=forbidden, etc.
HTTP 500..599 means "the server has a problem / is misconfigured"
see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more info.

Resources