I require in-app purchases for certain functionality in my Android App. For users in countries where in-app purchases are not supported I want to make this functionality available for free.
How can one check if in-app purchases are supported in the user's Google Play country?
Problems with things I tried:
It seems not possible to determine the Play Store Country.
Checking
BillingClient.BillingResponseCode
forBILLING_UNAVAILABLE
does not help as this response may also be returned if "The Play Store app on the user's device is out of date" or "Google Play is unable to charge the user’s payment method".The
debugMessage
in theBillingResult
returned by theonBillingSetupFinished
callback ofBillingClient.startConnection
seems also not helpful as it incorrectly says "Google Play In-app Billing API version is less than 3" for unsupported countries. (I tried for China using VPN.)Checking the user's IP address would give wrong results if the user is in a country other than his Play country or uses a VPN.
Using location APIs would require location permissions and also give wrong results if the user is in a foreign country.