Lena wrote:To test my application (I'm in Ukraine), I take the iphone from my friend. In his iphone I get coordinates in Russian:
Соединенные Штаты Америки
СO
Do I need to delete a friend’s account from his iphone to see the coordinates in English?
I already addressed that in an earlier reply:
"Соединенные Штаты Америки" is Russian for "United States of America" (according to Google Translate). Kind of odd that you receive USA in Russian in that way. I suppose you will have to account for that, unless you can somehow request the result to be in English only. It looks like iOS's Geocoder API has a "preferredLocale" parameter for that purpose, but Embarcadero's TGeocoder class does not expose access to that. So you might need to use the API directly instead of Embarcadero's wrapper.
You should file a feature request with Embarcadero to add locale support to TGeocoder. In the meantime, the simplest workaround would be to just add "Соединенные Штаты Америки" to the list of country codes you check for:
Code: Select all
bool checkcountry = SameText(country, L"USA") ||
SameText(country, L"United States of America") ||
SameText(country, L"Соединенные Штаты Америки");
But then, you might need to do the same thing for every possible language that your app may run under (French? Spanish? etc). That could get a bit tedious, to say the least.
Lena wrote:I satrt my application from IDE. On the iphone, I see the window "Allow access to geodata?". I click "Allow" and get error:
First chance exception at $0000000100D08940. Exception class EUnsupportedPlatformService with message 'Unsupported platform service: Terminate'. Process geoios (1274)
And I fall into a file FMX.Platform.IOS:
Code: Select all
procedure TPlatformCocoaTouch.Terminate;
begin
FTerminating := True;
FRunning := False;
TMessageManager.DefaultManager.SendMessage(nil, TApplicationTerminatingMessage.Create);
raise EUnsupportedPlatformService.CreateFMT(SUnsupportedPlatformService, ['Terminate']); //<----HERE
end;
Looks like you are not the only person to encounter that, see
What is the proper way to terminate an iOS app?.
Per
Proper way to exit iPhone application, apparently iOS apps are
NOT SUPPOSED to exit themselves, they simply get sent to the background when the user closes them.
So, you will have to avoid calling Application->Terminate(), and also Close()'ing the MainForm. You will likely have to redesign your UI logic to simply block access to whatever functionality is location-specific, without actually exiting the app. Per
Apple's guidelines:
Q: How do I programmatically quit my iOS application?
There is no API provided for gracefully terminating an iOS application.
In iOS, the user presses the Home button to close applications. Should your application have conditions in which it cannot provide its intended function, the recommended approach is to display an alert for the user that indicates the nature of the problem and possible actions the user could take — turning on WiFi, enabling Location Services, etc. Allow the user to terminate the application at their own discretion.
...
Lena wrote:If I comment Close() no error and I see ShowMessage "Sorry this app is only for the state of Colorado USA."
Makes sense, since your code is not checking for the Russian encoding of "United States of America".