【发布时间】:2014-01-06 23:53:35
【问题描述】:
我正在尝试使用 MKStoreKit 在我的应用中实现应用内购买。它在大多数情况下都很好用,除了我无法弄清楚的一件事。我正在使用以下方法来恢复交易。
-(void)restoreToFullVersion:(UIViewController *)sender{
[MBProgressHUD showHUDAddedTo:sender.view animated:TRUE];
[[MKStoreManager sharedManager] restorePreviousTransactionsOnComplete:^{
[MBProgressHUD hideHUDForView:sender.view animated:TRUE];
[[NSNotificationCenter defaultCenter] postNotificationName:@"userDidUpgradeNotification" object:nil userInfo:nil];
[self upgradeSuccessful];
} onError:^(NSError *error) {
[MBProgressHUD hideHUDForView:sender.view animated:TRUE];
}];
}//end method
我已经 nslogged 完成块并且上面的代码都按预期工作,除非你然后调用
[MKStoreManager isFeaturePurchased:kMainNoncomsumable];
它返回假。我认为在恢复过程完成后 MKStoreManager 应该为 isFeaturePurchased 返回 true 是否正确,还是我错过了什么?
我只实现了一项非消耗性应用内购买,并使用 Cocoa-pods 将 MKStoreManager 包含到我的项目中。
似乎 SO 上的其他人也有相同的 problem,但我还没有找到有效的解决方案。
提前感谢所有帮助!
【问题讨论】:
标签: ios iphone cocoa-touch in-app-purchase mkstorekit