0

I'm developing a application where I want currency will be show with currency code depending locale configuration at the device. I'm trying with globalization native ionic plugin. All works fine if I write in my code the currency Code (e.g. EUR) but I'd like get it from locale config.

I can't find any way to do this. All examples I've found are writing currency Code. Then I'm asking if I'm trying to do something imposible.

Thanks...

Goltra
  • 113
  • 14

1 Answers1

0

After doing some digging I don't think there is a straighforward way of getting the currency from device information or locale.

The reason may be that there is not obvious link between language, location and currency used for making purchases.

The only external hint that you could use, might be through using the "In App Purchase 2" Ionic native plugin.

This does require activating In App Billing for your app in the Google Play store, or In App Purchase in the Apple App Store. Then, once you've created (non-free) products, you could check which currency is used in the product listings you receive from the store and take it as a hint regarding the user's preferred currency.

Other than that my best guess is to assume a default currency and manually assign a specific currency per locale.

What I have tested

None of these gave me any direct info regarding the user's preferred currency.

I'd like to get a better answer...

Community
  • 1
  • 1
Sébastien
  • 11,860
  • 11
  • 58
  • 78