Search Unity

[Closed] Country code from IAP?

Discussion in 'Unity IAP' started by _watcher_, Aug 27, 2016.

Thread Status:
Not open for further replies.
  1. _watcher_

    _watcher_

    Joined:
    Nov 7, 2014
    Posts:
    261
    Hi,

    I cant use IAP for all countries GooglePlay covers, because of taxation issues.

    How can i get country code from Unity IAP (or wherever), so that i can disable IAP for the countries outside of my selected countries (i get this list from google play) ?
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    Hi @_watcher_

    That is not a feature in Unity IAP. It is up to you to determine a user's country.

    Getting a user's location can be tricky. On devices that have the option, GPS is probably the most accurate way, but by itself won't give you the country code.

    Here is a thread where people are using a combination of Unity's location class and the Google maps api to determine a country:
    http://forum.unity3d.com/threads/country-region-location-detection-for-high-score-postings.61334/

    The manual has more information about the location service:
    http://docs.unity3d.com/ScriptReference/LocationService.Start.html
    http://docs.unity3d.com/ScriptReference/LocationInfo.html
     
  3. erika_d

    erika_d

    Joined:
    Jan 20, 2016
    Posts:
    413
    Hi @_watcher_,

    We haven't really tested this situation, and we are looking into adding it to our test suite, but what we would expect to happen is IAP returning an error when trying to initialize in countries where you don't have IAP enabled on Google's side. If this is not the behavior you're seeing, what are you experiencing?
     
  4. _watcher_

    _watcher_

    Joined:
    Nov 7, 2014
    Posts:
    261
    Thank You for the reply, Unity experts!

    @ap-unity: Good feedback, IP or GPS location detection ... allright - however, im not sure i can use this. More below.
    @erika_d: My use case is a bit different - I want to ALLOW country in google play - where i have to pay VAT (because google wont pay in that country. Say Japan. However im a small business and i am unable to deduct that VAT on my own. So in this case, I would still like to allow the app to be played by user from Japan, but i want to disable IAP.

    It seems google should have additional filter that it doesn't have - list of countries for which to allow IAP - so i can select a country in distribution (like Japan), but deselect that same country in IAP purchases. I might be mistaken - in fact im not sure, how "user" is determined. Say i am german using German credit card, and i go to Japan. VAT for Germany is deducted by google. VAT for Japan is not. While in Japan i go to google play store, and download an app, where i pay for IAP using my german credit card.

    Now, I was not able to find info on this - does google process me as German customer (because of credit card) and thus deduct the VAT? Or since country of distribution for the app is Japan, does it not deduct the VAT from my IAP payment? Please understand i can not deduct VAT on my own. Thus i blocked Japan as country of distribution completely. This is wrong, and this is what i want to amend - dont block app distribution, only block "IAP for Japan". I messaged google asking this and should get the answer on how to determine what country user belongs to (exactly how they do it), so i can use in-app check to disable IAP if i need to. I'm unsure GPS/IP will suffice, what i need to know is what check they use. Because its them that deduct or don't deduct the VAT for me.

    Anyways my intention is to disable IAP in my app distributed in Japan. I also want to enable the Japan as country of distribution, so users can still play the app and use Unity Ads. Japan was only used as example, there are many such countries.

    Sorry for the long reply.
    If you're still here and have a suggestion, go ahead, please.
     
  5. erika_d

    erika_d

    Joined:
    Jan 20, 2016
    Posts:
    413
    Hi @_watcher_,

    I didn't realize Google doesn't let you specify which countries IAP can be enabled for separate from distribution! When you contacted them did you ask them about why that is? I'll be interested to hear what they say about how they determine users' locations.

    I agree with you that it seems best to determine location either via a Google API or at least using the same method as Google. I don't have any alternate ideas for that. Once you have determined the location, you could either let IAP initialize no matter what, and then only display the IAP buttons based on what their location is, or you could surround all IAP code with an ifdef that is based on their location, thereby preventing IAP from initializing in locations where you don't want it to.

    Sorry I can't be of more help!
     
Thread Status:
Not open for further replies.