I would like to limit the use of my app to 2 devices maximum, but I don't know how to do. I believed that the receipt was unique, but it seems that it is not the case. What I would like to do is store the receipt on the server, and limit the install only to 2 devices. My problem is that I don't find any unique id for that. I don't have access to the apple id and the receipt is different when installed on each devices. I believed that I could read the receipt to find an unique info but I cannot read it...
//APP STORE VALIDATION
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
NSData *receipt = [NSData dataWithContentsOfURL:receiptURL];
if (receipt)
{
/* ... Send the receipt data to your server ... */
// Build data from dictionary
NSString *base64Encoded = [receipt base64EncodedStringWithOptions:0];
// Print the Base64 encoded string
NSLog(@"Encoded: %@", base64Encoded);
NSString *identifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
NSString *name = [[UIDevice currentDevice] name];
struct utsname systemInfo;
uname(&systemInfo);
NSString* type = [NSString stringWithCString:systemInfo.machine
encoding:NSUTF8StringEncoding];
NSString *serialNumber = [NSString stringWithFormat:@"%@ %@", [[UIDevice currentDevice] systemName], [[UIDevice currentDevice] systemVersion]]; //serial number can be rejected from app store
NSString *url_string = @"https://xxxx.com/go2factauth/auth.php";
url_string = [url_string stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSLog(@"URL : %@", url_string);
NSDictionary *infoDict=@{@"receipt-data":base64Encoded, @"device": @{@"udid":identifier, @"name":name , @"serialNumber":serialNumber,@"type":type}};
[[DataManagement sharedManager] callWebServiceWithPostMethod:url_string withBytes:receipt withDict:infoDict];
Any ideas?