Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error PluginGeocoder.m iOS 17 #2930

Open
2 of 5 tasks
keriroso opened this issue May 15, 2024 · 0 comments
Open
2 of 5 tasks

Error PluginGeocoder.m iOS 17 #2930

keriroso opened this issue May 15, 2024 · 0 comments

Comments

@keriroso
Copy link

keriroso commented May 15, 2024

I'm submitting a ... (check one with "x")

  • question
  • any problem or bug report

OS: (check one with "x")

  • Android
  • iOS
  • Browser

Current behavior:

Hello, I am experiencing an issue with one of my applications. The Cordova-Google-Maps plugin is failing on iOS 17, specifically in the initialization of the Geocoder plugin that uses NSLocale ISOCountryCodes to get a list of country codes.

Expected behavior:

Screen capture or video record:
Captura de pantalla 2024-05-14 a la(s) 09 28 37

Captura de pantalla 2024-05-14 a la(s) 09 29 47

Related code, data or error log (please format your code or data):
Reason: In iOS 17, the option to extract NSLocale ISOCountryCodes country codes in Objective-c is not supported in this new version of the operating system, resulting in a nil value being returned and causing the application to terminate unexpectedly.

Action taken: A manual adjustment was made to the plugin by validating an action found in the Apple developer manual,
The system version is validated and based on this, a different action is taken for iOS 17, regionCode is used and not 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];
    }
pcsantana pushed a commit to pcsantana/cordova-plugin-googlemaps that referenced this issue May 17, 2024
iizuka-rights added a commit to rights-s/cordova-plugin-googlemaps that referenced this issue Oct 3, 2024
iizuka-rights added a commit to rights-s/cordova-plugin-googlemaps that referenced this issue Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant