Skip to content

Commit

Permalink
[FIX] From mapsplugin#2930
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulo Santana committed May 17, 2024
1 parent c1b5c66 commit 1cdf320
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ios/GoogleMaps/PluginGeocoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ - (void)pluginUnload
}
- (void)pluginInitialize
{
NSArray *countryCodes = [NSLocale ISOCountryCodes];
NSArray *countryCodes;
if (@available(iOS 17.0, *)) {
// Use regionCode for iOS 17 and above
countryCodes = [[NSLocale currentLocale] regionCode] ? @[ [[NSLocale currentLocale] regionCode] ] : [NSLocale ISOCountryCodes];
} else {
// Use ISOCountryCodes for versions below iOS 17
countryCodes = [NSLocale ISOCountryCodes];
}
NSMutableArray *countries = [NSMutableArray arrayWithCapacity:[countryCodes count]];
NSString *currentLanguage = [[NSLocale preferredLanguages] objectAtIndex:0];

Expand Down

0 comments on commit 1cdf320

Please sign in to comment.