TomD
TomD

Reputation: 614

Determine Play Store Country

I'm looking to see if there is any way to tell what country version of the play store a user has on their android phone.

Basically I want to turn off In-App Purchasing for certain countries (for tax collecting reasons). I have tried Locale but that can be changed by changing the Language in the phone. I figured the only thing that can determine what country they are from would be by the Google account that is connected to the play store.

Any help would be much appreciated. Thank You.

Upvotes: 15

Views: 24937

Answers (5)

j2esu
j2esu

Reputation: 1687

UPDATED ANSWER

In Google Play Billing 6.1.0+ they finally added the designated method to get the country: BillingClient.getBillingConfigAsync()

PREVIOUS ANSWER

I have one idea about it, but i haven't try it yet (maybe smbd can give some feedback about using this approach).

The idea is to use getSkuDetails to get price_currency_code and disable billing for some currencies.

Upvotes: 8

Nithin Raja
Nithin Raja

Reputation: 1242

Google will determine the Play store country based on the Ip Address when the user has signed up the google account in their Mobile.

  • We can check this by removing the google account from Settings > Accounts.

  • Change the IP address using any VPN like (Tunnel Bear)

  • Add the google account.

  • Play store country will be changed

Upvotes: 1

androidguy
androidguy

Reputation: 3175

There is no way to do precisely this. Instead, you could accept an answer to a similar question,

What country is the phone currently connected to?

This can be answered reliably as long as the device is a phone. Have to support tablets? Still no luck...

Upvotes: 0

Iris Veriris
Iris Veriris

Reputation: 456

You can not tell what country version of the play store a user has on their android phone programmatically because google play determines users country internally.

The only way to do that is to get users current location via LocationServices, in that case you need to add location permissions.

There are a few workarounds to that problem that does not work in all cases, like getting users career information which can provide country information.

Upvotes: 0

Otra
Otra

Reputation: 8158

I'm not sure about programmatically checking their google account country, but if you want to target specific regions, you can do that within the Google Play Developer console.

Geographic targetting

Google Play Instructions for determining country

Even if it isn't a program/code answer, I hope this solves your problem much more easily than having to figure that out in your application.

Upvotes: 0

Related Questions