Can I implement in-app purchases only for a subset of countries?

Is there a way to use In-App purchases, which they are NOT available in the USA, and at the same time find out whether they are available or not, and if not, to perform special tasks for customers in the USA who cannot use them?

+5
source share
2 answers

You can use CLLocationManager to find the user's location, and then use MKReverseGeocoder to find out what country they are in.

Some people will refuse access to location information. As a backup, you can use the language in which the current device is located (but there are some obvious problems with this approach):

NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

:

if(in USA){ 
  do whatever, don't allow in-app purchases
} else {
  allow in app purchases
}
+2

, , - . , ( , , ), , .

SKProductsRequest *productRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:productId]]; 
productRequest.delegate = self;
[productRequest start];


-(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
    if ([[response products] count] > 0) {
        // display purchase link
    } else {
        // display alternative UI
    }
}
0

All Articles