我正在尝试将我的应用从付费转为免费增值。我不想留下任何用户,因此我正在实施一种方法,用于检查应用程序何时购买以自动添加应用内购买。
+ (void)checkForOG {
RMAppReceipt *appReceipt = [RMAppReceipt bundleReceipt];
NSLog(@"Path is: %@", [[[NSBundle mainBundle] appStoreReceiptURL] path]);
if (!appReceipt) {
NSLog(@"No app receipt!");
[[RMStore defaultStore] refreshReceiptOnSuccess:^{
NSLog(@"Success!");
RMAppReceipt *appReceipt = [RMAppReceipt bundleReceipt];
if ([[appReceipt originalAppVersion] floatValue] < 2.0) {
NSLog(@"Yes2! %@", [appReceipt originalAppVersion]);
}
} failure:^(NSError *error) {
NSLog(@"Test");
NSLog(@"Error: %@", error);
}];
} else {
if ([[appReceipt originalAppVersion] floatValue] < 2.0) {
NSLog(@"Yes1! %@", [appReceipt originalAppVersion]);
}
}
// [self setRemoveAds:1];
}
现在,此方法记录的唯一内容是Path is: ...
和No app receipt!
。没有其他的。我不知道我做错了什么。你呢?
答案 0 :(得分:-2)
请务必添加所有广告连播:
pod 'RMStore', '~> 0.7'
pod 'RMStore/AppReceiptVerificator'
pod 'RMStore/TransactionReceiptVerificator'
pod 'RMStore/KeychainPersistence'
pod 'RMStore/NSUserDefaultsPersistence'
并从docs
执行了所有必要步骤