我想将我的应用程序的使用限制为最多 2 台设备,但我不知道该怎么做。我相信收据是独一无二的,但事实似乎并非如此。我想做的是将收据存储在服务器上,并将安装限制为仅限 2 台设备。我的问题是我没有找到任何唯一的ID。我无权访问 Apple ID,并且在每台设备上安装时收据都不同。我相信我可以阅读收据以找到独特的信息,但我无法阅读......
//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];
有什么想法吗?
最佳答案
Apple 记录的唯一通过任何唯一设备 ID 限制 iOS 应用程序安装的方法是通过开发人员直接安装 XCode、开发人员进行 Ad Hoc 分发或通过企业许可部署。不是通过应用商店。请注意,开发者协议(protocol)可能不允许销售这些直接安装的应用程序。而且它们有有效期。
关于iOS:如何通过 apple id 帐户(或其他)将我的应用程序安装限制为仅 2 台设备?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49334619/