iOS 6.1中的Google Places API问题?

时间:2015-09-02 17:51:58

标签: ios google-api google-places-api google-maps-sdk-ios ios6.1

我允许用户在我的iPhone项目中搜索地点。为此我正在使用Google Places API for iOS。我在我的项目中使用以下代码。

- (void) makeAutoComplete :(UITextField *) textField
{
    NSLog(@"Searching for :%@",textField.text);
    GMSAutocompleteFilter *filter = [[GMSAutocompleteFilter alloc] init];
    filter.type = kGMSPlacesAutocompleteTypeFilterEstablishment;
//    [_placesClient autocompleteQuery:@"fun republic mall"
    [_placesClient autocompleteQuery:textField.text
                              bounds:nil
                              filter:filter
                            callback:^(NSArray *results, NSError *error) {
                                if (error != nil) {
                                    NSLog(@"Autocomplete error %@", [error localizedDescription]);
                                    return;
                                }
                                //                                NSLog(@"%@",results);
                                NSString *searchedResults = @"";
                                for (GMSAutocompletePrediction* result in results) {

                                    NSLog(@"Result '%@' with placeID %@", result.attributedFullText.string, result.placeID);
                                    searchedResults = [searchedResults stringByAppendingString:[NSString stringWithFormat:@"%@ /n",result.attributedFullText.string]];


                                }
                                //displaying searched results in console
                                NSLog(@"Filter  %@",searchedResults);


                            }];

}

它在我的iOS 8.1版本设备中运行良好。但是当我尝试在iOS 6.1版本中运行相同的项目时,我收到以下错误。

  dyld: Symbol not found: _NSURLSessionDownloadTaskResumeData
  Referenced from: /var/mobile/Applications/0451B511-AA2F-0000-0000-0FA4D53DABC1/GMS.app/GMS
  Expected in: /System/Library/Frameworks/Foundation.framework/Foundation
 in /var/mobile/Applications/0451B511-AA2F-0000-0000-0FA4D53DABC1/GMS.app/GMS

即使我尝试在iOS 6.1中运行SDKDemo,我也会遇到同样的错误。但它在OS 8.1设备中运行良好。

任何人都可以提供在iOS 6.1版本中使用Google地方搜索API的任何建议。

我还想知道使用Google Places API

的最低iOS版本支持

2 个答案:

答案 0 :(得分:2)

适用于iOS的Google Maps SDK仅支持iOS 7.0及更高版本。

来自https://developers.google.com/maps/documentation/ios-sdk/releases

  

Google Maps SDK for iOS的最低目标iOS版本现在为7.0。不再支持6.0版。

答案 1 :(得分:1)

仅iOS 7.0以上版本支持SDK。所以请使用合适的一个来运行Google maps SDK。