3 Replies
      Latest reply: Sep 28, 2016 2:31 AM by eskimo RSS
      aniketkote Level 1 Level 1 (0 points)

        When user downloads the application from app store, I want to find out from which app store user has downloaded that application.

         

        One solution I could see is:

        To use the current locale of the user to detect in which country they are… but it could fail sometimes, so I'm not very sure if a not 100% effective way to detect the AppStore would work for me.

         

        [[NSLocale currentLocale] objectForKey: NSLocaleCountryCode]

         

        So Can anyone help me with this issue?

        • Re: Find out app store.
          eskimo Apple Staff Apple Staff (7,505 points)

          When user downloads the application from app store, I want to find out from which app store user has downloaded that application.

          AFAIK there’s no supported way to do this.

          To use the current locale of the user to detect in which country they are …

          Don’t do that.  There’s no guaranteed relationship between between language (or locale) and the App Store country.  For example, when visiting my family in Australia I may need to switch to the AU store to get AU-specific apps, but my device’s language and locale will still be based on where I live.

          You may get recommendations to do this by looking at undocumented fields in the app’s App Store receipt.  That’s also a bad idea.  Anything receipt field that’s not explicitly documented in the Receipt Validation Programming Guide is off limits.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

            • Re: Find out app store.
              aniketkote Level 1 Level 1 (0 points)

              Thanks eskimo for your response.

               

              Any other work around to this, any API's which return me the json of app information which is on iTunes Store?

               

              Like Apple Lookup(https://itunes.apple.com/lookup?id=appID), Any chance of achieving this?

                • Re: Find out app store.
                  eskimo Apple Staff Apple Staff (7,505 points)

                  Any other work around to this, any API's which return me the json of app information which is on iTunes Store?

                  That lookup mechanism is just an HTTPS web service; you can talk to it with NSURLSession.  Two things:

                  • I don’t see how this helps with your original question.

                  • Before using a web service like this you should check with the vendor to make sure your usage complies with their policy.  In this case the vendor is Apple but, alas, I can’t help you with this; my main focus is APIs and thus I’m not familiar with Apple’s web service policies.

                  Share and Enjoy

                  Quinn “The Eskimo!”
                  Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                  let myEmail = "eskimo" + "1" + "@apple.com"