アプリ内購入に問題があります。サーバーにリクエストを送信した後、 から返された製品はありませんSKProductsRequest
。
次のようにリクエストを送信します。
NSMutableSet *identificators = [[NSMutableSet alloc] init];
[identificators addObject:kInAppPurchaseOneWeekIdentifier];
[identificators addObject:kInAppPurchaseOneMonthIdentifier];
[identificators addObject:kInAppPurchaseSixMonthsIdentifier];
SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:identificators];
request.delegate = self;
[request start];
[identificators release];
Consts.hにはそれらがあります
// In App Purchase
#define kInAppPurchaseOneWeekIdentifier @"com.astroboxapp.iap.OneWeek"
#define kInAppPurchaseOneMonthIdentifier @"com.astroboxapp.iap.OneMonth"
#define kInAppPurchaseSixMonthsIdentifier @"com.astroboxapp.iap.SixMonths"
私のクラスで私が実装した
-(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {
if ( [response.products count] > 0 ) {
// i've do my stuff - show the IAP to the user
} else {
// here goes the error handling
}
}
私の場合[response.products count]
、空の配列/辞書なので、エラーがスローされます。
編集:私は何をしましたか?
新しい IAP を作成し、アプリに関連付けました。製品 ID も変更し、Consts.h で変更しました。
アプリのバージョンを 1.0 から 1.1 に変更しようとしましたが、このバージョンの IAP を変更するのに役立ちました。
まだデバイスで動作していませんが、シミュレーターには IAP のエントリがありますが、テストできます。StoreKit では、シミュレーターからの購入をテストできないためです。
私のデバイスでは、ストアからサインアウトしています。