我试图让MKStoreKit与我的Cocos2D游戏一起工作。它看起来非常简单,我已经多次执行了所有步骤(检查我是否正确完成),但仍然无法实现。我可以检索产品名称,价格和描述等,但我可以使用共享的MKStoreKitManager进行购买。MKStoreKit购买功能什么都不做
这是我购买一个产品代码:
if([MKStoreManager isFeaturePurchased: @"com.testing.iap.removeAds"]) {
NSLog(@"No ads");
}else{
NSLog(@"Ads");
NSLog(@"Buying feature...");
[[MKStoreManager sharedManager] buyFeature: @"com.testing.iap.removeAds"
onComplete:^(NSString* purchasedFeature)
{
NSLog(@"Purchased: %@", purchasedFeature);
// provide your product to the user here.
// if it's a subscription, allow user to use now.
// remembering this purchase is taken care of by MKStoreKit.
}
onCancelled:^
{
NSLog(@"Something went wrong");
// User cancels the transaction, you can log this using any analytics software like Flurry.
}];
}
基本上,如果该产品尚未以前购买的,打完折购买过程。这个问题没有发生!我甚至没有得到onCancelled被调用,除了我可以忽略的错误信息(即iCloud支持和自定义服务器选项)之外,没有任何错误信息。
任何人都可以阐明这是什么阻止我?
注:我测试运行iOS 5.1
我现在正面临这个问题.... – user216661 2013-01-26 19:09:14
比浪费时间修复第三方解决方案更容易实现StoreKit.framework和相关协议SKPaymentTransactionObserver,SKProductsRequestDelegate,SKRequestDelegate。 .. – holex 2013-08-18 08:41:19