2017-08-24 2 views
0

J'utilise GMSAutoCompleteViewController de l'API Google Adresses dans mon projet iOS. Soudainement, mon GMSAutoCompleteViewController continue à me donner l'erreur "Impossible de charger les résultats de la recherche".Google Adresses iOS - Impossible de charger le résultat de recherche

J'ai régénéré ma clé API en utilisant une nouvelle clé. J'ai tout essayé, mais encore comment ça ne marche pas. J'utilise Objectif-C. Quelqu'un peut-il aider?

code

GMSAutocompleteViewController *acController = [[GMSAutocompleteViewController alloc] init]; 
    acController.delegate = self; 
[self.navigationController pushViewController:acController animated:YES]; 

délégué Méthodes

- (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); 
    NSLog(@"Latitude = %.20f",place.coordinate.latitude); 
    NSLog(@"Longitude = %.20f",place.coordinate.longitude); 
    NSLog(@"Type = %@",place.types); 
    NSLog(@"Place ID = %@",place.placeID); 
    //[self dismissViewControllerAnimated:YES completion:nil]; 
    [self.navigationController popViewControllerAnimated:YES]; 

    /* Call and API in background to get the address according to the new LAT AND LONG as well 
    Once get the address from there we can store the latitude and longitude in the cache 
    if type of search is Postal code then we have to call another web service i.e. FIND ADDRESS to get the whole exact address */ 

    [self callWS_ConvertLatLongWithLatitude:[NSString stringWithFormat:@"%.20f",place.coordinate.latitude] 
           andLongitude:[NSString stringWithFormat:@"%.20f",place.coordinate.longitude] 
           inBackground:NO]; 

} 

- (void)viewController:(GMSAutocompleteViewController *)viewController 
didFailAutocompleteWithError:(NSError *)error { 

    NSLog(@"error: %ld", [error code]); 

    [self.navigationController popViewControllerAnimated:YES]; 

} 

// User canceled the operation. 
- (void)wasCancelled:(GMSAutocompleteViewController *)viewController { 
    NSLog(@"Autocomplete was cancelled."); 

    [self.navigationController popViewControllerAnimated:YES]; 
} 

// Turn the network activity indicator on and off again. 
- (void)didRequestAutocompletePredictions:(GMSAutocompleteViewController *)viewController { 
    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; 
} 

- (void)didUpdateAutocompletePredictions:(GMSAutocompleteViewController *)viewController { 
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; 
} 
+0

Avant de pouvoir obtenir le résultat de la recherche ou au démarrage, vous obtenez cette erreur? et avez-vous mis GMSPlacesClient.provideAPIKey ("API_KEY_HERE") dans didFinishLaunchingWithOptions – Govaadiyo

+0

jusqu'à hier, j'ai pu obtenir des résultats de recherche. soudainement aujourd'hui je reçois l'erreur. – Shah

+0

si je continue à appuyer sur "Try Again", il me montre une liste de résultats, je sélectionne un résultat de là et encore une fois il me montre "Impossible de charger le résultat de recherche" – Shah

Répondre