Prevent app crash if the `<name>` tag of the config.xml is non-English language.
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.2.0-beta-20180125-2154" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+<plugin id="cordova-plugin-googlemaps" version="2.2.0-beta-20180126-0043" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>cordova-plugin-googlemaps</name>
<js-module name="BaseClass" src="www/BaseClass.js">
<runs />

MODIFY
src/ios/GoogleMaps/CordovaGoogleMaps.m
src/ios/GoogleMaps/CordovaGoogleMaps.m
[alert addAction:ok];
+ [self.viewController presentViewController:alert
+ animated:YES
+ completion:nil];
return;
}
self.pluginLayer.isSuspended = false;
}
+ /*---------------------------------------------------------------------------------------
+ * If CFBundleExecutable is not English, the Google Maps SDK for iOS will crash.
+ * So must be English.
+ *
+ * If you want to use non-english name for your app, you need to change your config.xml like this.
+ *
+ * <?xml version='1.0' encoding='utf-8'?>
+ * <widget id="(package name)" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+ * <name short="(non-english app name)">(english app name)</name>
+ *---------------------------------------------------------------------------------------*/
+
+ NSDictionary *info = [[NSBundle mainBundle] infoDictionary];
+ NSString *CFBundleExecutable = [info objectForKey:@"CFBundleExecutable"];
+ NSArray *tagschemes = [NSArray arrayWithObjects:NSLinguisticTagSchemeLanguage, nil];
+ NSLinguisticTagger *tagger = [[NSLinguisticTagger alloc] initWithTagSchemes:tagschemes options:0];
+ [tagger setString:CFBundleExecutable];
+ NSString *language = [tagger tagAtIndex:0 scheme:NSLinguisticTagSchemeLanguage tokenRange:NULL sentenceRange:NULL];
+
+ if (([@"en" isEqualToString:language] == NO) && ([language hasPrefix:@"en_"] == NO)) {
+ NSString *message = [NSString stringWithFormat:@"Google Maps SDK for iOS crashes with app name '%@'.\nCheck out the comment in the CordovaGoogleMaps.m file.", CFBundleExecutable];
+
+ UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"[action required]"
+ message:message
+ preferredStyle:UIAlertControllerStyleAlert];
+
+ UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"CLOSE", @"CLOSE")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ [alert dismissViewControllerAnimated:YES completion:nil];
+
+ CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:[NSString stringWithFormat:@"Can not use '%@' for CFBundleExecutable", CFBundleExecutable]];
+ [(CDVCommandDelegateImpl *)self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+
+ }];
+
+ [alert addAction:ok];
+
+ [self.viewController presentViewController:alert
+ animated:YES
+ completion:nil];
+ return;
+ }
+
dispatch_async(dispatch_get_main_queue(), ^{
CDVViewController *cdvViewController = (CDVViewController*)self.viewController;

MODIFY
src/ios/GoogleMaps/PluginGeolocation.m
src/ios/GoogleMaps/PluginGeolocation.m
[alert addAction:ok];
+ [self.viewController presentViewController:alert
+ animated:YES
+ completion:nil];
} else {

Prevent app crash if the `<name>` tag of the config.xml is non-English language. #2017