简体   繁体   中英

iOS app binary rejected - IPv6

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];

解决方案是将服务器重新配置为与IPv4和IPv6兼容

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM