Dren Dren - 9 months ago 174
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

add

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

This works for me