Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
407 views
in Technique[技术] by (71.8m points)

iphone - restoreCompletedTransactions broken?

Is restoreCompletedTransactions broken in SDK 4.3 ?

I am trying to restore my auto-renewable subscription. It is not resulting in callback to updatedTransactions. Here is my code.

 {
 ....
 [appDelegate.inapp loadStore];

 [[SKPaymentQueue defaultQueue]  restoreCompletedTransactions];
 ....
 }

Expecting callback to updatedTransactions, but do not receive it.

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
     NSLog(@"IN updatedTransactions,  transaction.transactionState");

    for (SKPaymentTransaction *transaction in transactions)
    {

        switch (transaction.transactionState)
        {
            ...
            ...
            case SKPaymentTransactionStateRestored:
            NSLog(@"IN updatedTransactions,  SKPaymentTransactionStateRestored");
            [self restoreTransaction:transaction];
            break;

        }
    }
}

But I do receive call to this at the end.

-(void) paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue {
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This can still(1) happen if you're testing in the Sandbox environment and your Test User is broken. Create a new Test User in iTunes Connect, and try again.

It's not entirely clear what makes Test Users go bad; from what I gather, using them once in a non-sandbox environment can do this, but there may be other reasons as well.

(1) Xcode 4.3.1, iOS SDK 5.1


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...