[英]How to know users google play country from inside the android app?
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.我们根据一些事情进行猜测,但发生的情况是我们猜测国家并向他显示 x 价格,当用户继续使用谷歌付款时,谷歌检测到另一个国家(基于 Playstore 帐户?)并向他显示 y 价格。 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.有没有一个api,我们可以调用它来了解与google对国家/地区的理解相匹配的国家/地区。
(It has been repeated but about 8 years ago.. so i am not sure if something has changed since) (它已经重复了,但大约在 8 年前......所以我不确定从那以后是否发生了一些变化)
Why don't you try to get Locale
from the system & perform operations further according to it..为什么不尝试从系统中获取Locale
并根据它进一步执行操作..
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.请点击以下链接了解详细信息,目前无法将国家与 Play 商店帐户关联。 But you can trick around to fix it.但是你可以欺骗来修复它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.