How to know users google play country from inside the android app?

1.2k views Asked by At

We have some in-app products and subscriptions. The price varies from one country to another. The problem is that we dont know how to detect the country within the app. We are guessing based on a few things but what happens is that we guess the country and show him x price and when the user proceeds to google payment, google detects another country (based on playstore account?) and shows him y price. This is a violation of google policy and they want us to fix it. But how do we fix it? Is there an api which we can call to know the country which matches with google's understanding of the country.

(It has been repeated but about 8 years ago.. so i am not sure if something has changed since)

1

There are 1 answers

2
I Am The Blu On

Why don't you try to get Locale from the system & perform operations further according to it..

Try this thing to get the current locale of the user

Locale current = ConfigurationCompat.getLocales(getResources().getConfiguration()).get(0);

If you need some more information regarding it, let me know.

    --------------   EDIT   ------------------

follow the link below for detailed information, it not possible to get the country linked with play store account for now. But you can trick around to fix it.

Determine Play Store Country