In order to synchronize with Android behavior, comment out the alert dialog which is displayed when application does not have geolocation permission
MODIFY
src/ios/GoogleMaps/PluginLocationService.m
src/ios/GoogleMaps/PluginLocationService.m
// kCLAuthorizationStatusDenied
// kCLAuthorizationStatusRestricted
//----------------------------------------------------
- NSString *LOCATION_IS_UNAVAILABLE_ERROR_TITLE = [PluginUtil PGM_LOCALIZATION:@"LOCATION_IS_UNAVAILABLE_ERROR_TITLE"];
- NSString *LOCATION_IS_UNAVAILABLE_ERROR_MESSAGE = [PluginUtil PGM_LOCALIZATION:@"LOCATION_IS_UNAVAILABLE_ERROR_MESSAGE"];
- UIAlertController* alert = [UIAlertController alertControllerWithTitle:LOCATION_IS_UNAVAILABLE_ERROR_TITLE
- message:LOCATION_IS_UNAVAILABLE_ERROR_MESSAGE
- preferredStyle:UIAlertControllerStyleAlert];
-
- NSString *closeBtnLabel = [PluginUtil PGM_LOCALIZATION:@"CLOSE_BUTTON"];
- UIAlertAction* ok = [UIAlertAction actionWithTitle:closeBtnLabel
- style:UIAlertActionStyleDefault
- handler:^(UIAlertAction* action)
- {
+
NSString *error_code = @"service_denied";
NSString *error_message = [PluginUtil PGM_LOCALIZATION:@"LOCATION_IS_DENIED_MESSAGE"];
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:json];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
- [alert dismissViewControllerAnimated:YES completion:nil];
- }];
-
- [alert addAction:ok];
-
-
- [self.viewController presentViewController:alert
- animated:YES
- completion:nil];
+//
+// NSString *LOCATION_IS_UNAVAILABLE_ERROR_TITLE = [PluginUtil PGM_LOCALIZATION:@"LOCATION_IS_UNAVAILABLE_ERROR_TITLE"];
+// NSString *LOCATION_IS_UNAVAILABLE_ERROR_MESSAGE = [PluginUtil PGM_LOCALIZATION:@"LOCATION_IS_UNAVAILABLE_ERROR_MESSAGE"];
+// UIAlertController* alert = [UIAlertController alertControllerWithTitle:LOCATION_IS_UNAVAILABLE_ERROR_TITLE
+// message:LOCATION_IS_UNAVAILABLE_ERROR_MESSAGE
+// preferredStyle:UIAlertControllerStyleAlert];
+//
+// NSString *closeBtnLabel = [PluginUtil PGM_LOCALIZATION:@"CLOSE_BUTTON"];
+// UIAlertAction* ok = [UIAlertAction actionWithTitle:closeBtnLabel
+// style:UIAlertActionStyleDefault
+// handler:^(UIAlertAction* action)
+// {
+// NSString *error_code = @"service_denied";
+// NSString *error_message = [PluginUtil PGM_LOCALIZATION:@"LOCATION_IS_DENIED_MESSAGE"];
+//
+// NSMutableDictionary *json = [NSMutableDictionary dictionary];
+// [json setObject:[NSNumber numberWithBool:NO] forKey:@"status"];
+// [json setObject:[NSString stringWithString:error_message] forKey:@"error_message"];
+// [json setObject:[NSString stringWithString:error_code] forKey:@"error_code"];
+//
+// CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:json];
+// [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+// [alert dismissViewControllerAnimated:YES completion:nil];
+// }];
+//
+// [alert addAction:ok];
+//
+//
+// [self.viewController presentViewController:alert
+// animated:YES
+// completion:nil];
} else {

In order to synchronize with Android behavior, comment out the alert dialog which is displayed when application does not have geolocation permission #2350