开发者

Turning off an in-app purchase?

We currently have a live app that features episodic content in the App store.

We're re-working our pricing, and inste开发者_开发技巧ad of offering individual episodes for purchase, we want to have it as simply an entire pack of episodes.

My question is this: If I set my old identifiers to NOT cleared for sale, would a user who previously purchased that content still be allowed access to it? (Meaning if I query whether they've purchased it, will it return true)

I'm new to the in-app purchase side of apps, and I'm not entirely sure how that works.

Also, if I delete the identifier from iTunesConnect, what happens? Should this even be done?

Thanks in advance for any insight


When using [[SKPaymentQueue defaultQueue] restoreCompletedTransactions];, Apple will return all completed transactions in a SKPaymentQueue which is a collection of transactions. The transaction will contain the the payment object. The payment object will contain the productIdentifier. This info is available despite your deletion. Thus you may honor past purchases that are no longer for purchase.

Here is some example code:

[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];

#pragma mark SKPayment Observer Delegate methods
- (void) paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue
{
    NSLog(@"received restored transactions: %i", queue.transactions.count);
    for (SKPaymentTransaction *transaction in queue.transactions)
    {
        NSLog(@"tran for product: %@ of state: %i", [[transaction payment] productIdentifier], [transaction transactionState]);
        switch ([transaction transactionState])
        {
            case SKPaymentTransactionStateRestored:
                NSLog(@"found restored transaction: %@ productIdentifier: %@", transaction.transactionIdentifier, transaction.payment.productIdentifier);
                [self yourRestoreProcessSelector:transaction];
                break;
            default:
                break;
        }
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜