Question: I'd like to be able to determine which store the user connects to from inside my app, so that I can direct them to some appropriate content for their device AND store. Does anyone know how to get this information?

Basically, if the user is in the UK, and connects to the UK store, I want my function/method to return GB, if in Korea, I want KR, Australia = AU etc. Any help would be appreciated.

Answer: 
So far you can use 2 methods with their pros and cons:

**StoreFront** 

->SDK >= 13 

->The **three-letter** code representing the country associated with the App Store storefront

```
if let storeFront = SKPaymentQueue.default().storefront{
    print("StoreFront CountryCode = ", storeFront.countryCode)
}
else {
    print("StoreFront NOT Available")
}

```

OR

**SKCloudServiceController**

-> Available from iOS 9.3. 

-> Requires permission. On tvOS it can become messy as I can't find a way to change the permissions in settings...

-> Permission text quite confusing.

```
let skCloudServiceController = SKCloudServiceController()
SKCloudServiceController.requestAuthorization { (status) in
    guard status == .authorized else {
        return
    }

    skCloudServiceController.requestStorefrontCountryCode(completionHandler: { (countryCode, error)  in
        if let error = error {
            print("Failure: ", error)
        }
            else if let countryCode = countryCode {
            print("Country code: ", countryCode)
        }
    })
}

```

Don't forget to include that in your .plist file:

```
<key>NSAppleMusicUsageDescription</key>
<string>Store information</string>

```
I need the same functionality. At the moment I'm considering reading using data from NSLocale as default, but adding a setting in settings.app for user to customise this if it does not match.

This function is taken from [an answer to another question of mine](https://stackoverflow.com/questions/2639684/itunes-music-store-link-maker-how-to-search-from-within-my-app/2668190#2668190).

```
- (NSString *)getUserCountry
{
    NSLocale *locale = [NSLocale currentLocale];
    return [locale objectForKey: NSLocaleCountryCode];
}

```