Dren Dren - 1 year ago 370
iOS Question

GMSServices GMSGeocoder reverseGeocodeCoordinate language of returned results in IOS

I have two applications which used in pair and both used GMSGeocoder from GMSServices for reverseGeocodeCoordinate search. But in first one results are coming in english, on other - in device local language. Device is the same.

I searched a lot, and found that now is no ways to make GMSGeocoder use specified language for result. It is impossible and we should use google API requests instead. But it works somehow, and i have no idea how to make second application return results in english language only.

Similar concerns mapView - different languages on the same device.

How to set english for GMSServices regardless device localization?

Local device language present
No local languge present

Answer Source

Copy paste answer from stackoverflow.com/a/24333593/4195406

In - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions


NSArray *languages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
    if (![[languages firstObject] isEqualToString:@"en"]) {
        [[NSUserDefaults standardUserDefaults] setObject:@[@"en"] forKey:@"AppleLanguages"];
        [[NSUserDefaults standardUserDefaults] synchronize];

This works for me

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download