MKStoreKitをCocos2Dゲームで動作させようとしています。実行するのは非常に簡単に見え、すべての手順を数回実行しました(正しく実行したことを確認するため)が、それでも機能させることができません。製品名、価格、説明などを取得できますが、共有のMKStoreKitManagerを使用して購入できます。
製品を購入するための私のコードは次のとおりです。
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サポートとカスタムサーバーオプション)以外にエラーメッセージはありません。
誰かが私を止めているのは何かに光を当てることができますか?
注: iOS5.1を実行しているiPhone4デバイスでテストしています