GooglePlaces GMSAutocompleteViewController停止搜索地点。
GMSPlacesClient键设置正确,工作正常。
如果您对此问题一无所知,请提供帮助。感谢。
答案 0 :(得分:2)
您的Google地方密钥将过期或您插入了错误的密钥。请检查您的密钥
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
答案 1 :(得分:0)
我也面临同样的问题。 我在添加了信用卡的帐户上制作了Google API密钥。但是该键无法正常工作。 为了解决此问题,请更新您的广告连播。