【发布时间】:2017-01-23 18:38:28
【问题描述】:
GooglePlaces GMSAutocompleteViewController 停止搜索地点。
GMSPlacesClient 密钥设置正确,工作正常。
如果您对此问题有所了解,请提供帮助。谢谢。
【问题讨论】:
标签: ios objective-c google-places-api
GooglePlaces GMSAutocompleteViewController 停止搜索地点。
GMSPlacesClient 密钥设置正确,工作正常。
如果您对此问题有所了解,请提供帮助。谢谢。
【问题讨论】:
标签: ios objective-c google-places-api
您的 Google Places 密钥将过期,或者您插入了错误的密钥。请检查您的密钥
import <GoogleMaps/GoogleMaps.h>
#import "ViewController.h"
@interface ViewController ()<GMSAutocompleteViewControllerDelegate>
@end
@implementation ViewController
// TODO: Add a button to Main.storyboard to invoke onLaunchClicked:
// Present the autocomplete view controller when the button is pressed.
- (IBAction)onLaunchClicked:(id)sender {
GMSAutocompleteViewController *acController = [[GMSAutocompleteViewController alloc] init];
acController.delegate = self;
[self presentViewController:acController animated:YES completion:nil];
}
// Handle the user's selection.
- (void)viewController:(GMSAutocompleteViewController *)viewController
didAutocompleteWithPlace:(GMSPlace *)place {
// Do something with the selected place.
NSLog(@"Place name %@", place.name);
NSLog(@"Place address %@", place.formattedAddress);
NSLog(@"Place attributions %@", place.attributions.string);
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)viewController:(GMSAutocompleteViewController *)viewController
didFailAutocompleteWithError:(NSError *)error {
// TODO: handle the error.
NSLog(@"error: %ld", [error code]);
[self dismissViewControllerAnimated:YES completion:nil];
}
// User canceled the operation.
- (void)wasCancelled:(GMSAutocompleteViewController *)viewController {
NSLog(@"Autocomplete was cancelled.");
[self dismissViewControllerAnimated:YES completion:nil];
}
@end
【讨论】:
我也面临同样的问题。 我在我的信用卡添加帐户上制作了谷歌 API 密钥。但是那个键不能正常工作。 要解决此问题,请更新您的 pod。
【讨论】: