Determine Play Store Country
Asked Answered
O

5

15

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.

Osteoarthritis answered 30/7, 2014 at 16:49 Comment(1)
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 changedAffidavit
C
0

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.

Cesarcesare answered 30/7, 2014 at 17:4 Comment(8)
This is what I am currently doing.. and having to support two apps to do it (one for USA and one for International). I am looking to see if it is possible to just maintain one baseline. Thank you thoughOsteoarthritis
So is it that you want to localize or that you want two different pay structures based on country?Cesarcesare
I want to only charge in the US.Osteoarthritis
So is it not possible to override the pricing for other currencies based on location? support.google.com/googleplay/android-developer/answer/1169947Cesarcesare
You can change prices there... but you can't set them to zero.Osteoarthritis
@Osteoarthritis have you found a way to determine play store country programmatically?Gaal
Unfortunately I have not.Osteoarthritis
That's not really separate apps, these are flavours of the same app.Pronoun
S
8

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.

Sadye answered 14/9, 2017 at 12:26 Comment(2)
I also think this is the best answer, and is what I will do for my app. On the iOS version, we are using the SKProduct.priceLocale - getSkuDetails seems to be the equivalent.Brynn
some currency_code have more than one country,not wellGavage
A
1

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

Affidavit answered 23/8, 2017 at 4:0 Comment(0)
C
0

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.

Cesarcesare answered 30/7, 2014 at 17:4 Comment(8)
This is what I am currently doing.. and having to support two apps to do it (one for USA and one for International). I am looking to see if it is possible to just maintain one baseline. Thank you thoughOsteoarthritis
So is it that you want to localize or that you want two different pay structures based on country?Cesarcesare
I want to only charge in the US.Osteoarthritis
So is it not possible to override the pricing for other currencies based on location? support.google.com/googleplay/android-developer/answer/1169947Cesarcesare
You can change prices there... but you can't set them to zero.Osteoarthritis
@Osteoarthritis have you found a way to determine play store country programmatically?Gaal
Unfortunately I have not.Osteoarthritis
That's not really separate apps, these are flavours of the same app.Pronoun
A
0

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.

Appellee answered 24/3, 2016 at 14:28 Comment(0)
E
0

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...

Ebb answered 27/7, 2017 at 3:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.