1

アプリ内購入に問題があります。サーバーにリクエストを送信した後、 から返された製品はありません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]、空の配列/辞書なので、エラーがスローされます。

編集:私は何をしましたか?

  1. 新しい IAP を作成し、アプリに関連付けました。製品 ID も変更し、Consts.h で変更しました。

  2. アプリのバージョンを 1.0 から 1.1 に変更しようとしましたが、このバージョンの IAP を変更するのに役立ちました。

  3. まだデバイスで動作していませんが、シミュレーターには IAP のエントリがありますが、テストできます。StoreKit では、シミュレーターからの購入をテストできないためです。

  4. 私のデバイスでは、ストアからサインアウトしています。

4

1 に答える 1

2

[response invalidProductIdentifers]配列が空でない場合は、製品がダウンロードできないことを意味します。したがって、これは通常、製品の数が空です。応答にあるものを確認してください。

于 2012-08-11T12:25:19.440 に答える