set googleMapApi timeout

phiz_2.41.5.7
Stewen 2023-08-23 17:33:29 +08:00
parent c030e31a5a
commit 99d074d023
1 changed files with 9 additions and 4 deletions

View File

@ -200,7 +200,11 @@
request.URL = urlComponents.URL;
}
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
configuration.timeoutIntervalForRequest = 5.0;
NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"Error: %@", error);
completion(nil);
@ -222,6 +226,7 @@
}];
[task resume];
}
+ (NSArray *)convertPlaceDictToArray:(NSDictionary*)dict{