When I do a MKLocalSearch I am getting a "request time out" error, when running on an iPhone 6s physical device. When I run on an emulator I do not have this problem.
I am using XCode 8 IOS 10, and the free provisioning profile. (last week I was using Xcode 7 and had no problems) Could this be because of the new provisioning profile.
Here is the error message:
Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={NSUnderlyingError=0x17024c630 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, NSErrorFailingURLStringKey=https://gsp-ssl.ls.apple.com/dispatcher.arpc?abBranchId=18.K, NSErrorFailingURLKey=https://gsp-ssl.ls.apple.com/dispatcher.arpc?abBranchId=18.K, _kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4, NSLocalizedDescription=The request timed out.}
The Code:
MKLocalSearch *search = [[MKLocalSearch alloc] initWithRequest:request];
[search startWithCompletionHandler:^(MKLocalSearchResponse *response, NSError *error) {
if (!error) {
MKMapItem *firstItem = response.mapItems.firstObject;
if (firstItem) {
//store in cache
_mapItemsDictionary[destination.destinationAddress] = firstItem;
handler(firstItem);
} else {
NSLog(@"ERROR : FirstObject from MapItems is null");
return;
}
} else {
NSLog(@"ERROR Could not get MAPITEM :%@",error.description);
handler(nil);
}
}];
I have this in my plist:
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>