Reputation: 33
I submitted an app to the store which was subsequently rejected, as it connects to an external server to load a json feed, which runs on IPv4. There are two separate internet connections where I work. The app successfully loads the json feed on one of the connections, but returns a 404 not found error on the other. Obviously when the app was in review it must have returned a 404 error. I am using a NSURLSession to connect to the api, as I understand it this is able to handle IPv4 to IPv6 mapping. What other method can I use to prevent this 404 not found error? The following is a snippet of my code:
NSURLSession *session = [NSURLSession sharedSession];
NSLog(@"%@", session.configuration);
[[session dataTaskWithURL:[NSURL URLWithString:jSONURLString]
completionHandler:^(NSData *rawData,
NSURLResponse *response,
NSError *error) {
if ((rawData != nil) && (error == nil)) {
//NSLog(@"Data: %@", rawData);
//NSLog(@"%@",response);
dispatch_async(dispatch_get_main_queue(), ^{
[self performSelector:@selector(returnRawData:) withObject:rawData];
});
}
else {
NSLog(@"error...");
dispatch_async(dispatch_get_main_queue(), ^{
[self performSelector:@selector(noFeedReturned)];
});
}
// handle response
}] resume];
Upvotes: 0
Views: 426
Reputation: 33
Solution was to reconfigure the server to be compatible with both IPv4 and IPv6
Upvotes: 1