Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Successful restore notification happening before verification completes #17

Open
Ghirigoro opened this issue Aug 16, 2012 · 0 comments
Open

Comments

@Ghirigoro
Copy link

The delegate method for a successful restore is invoked prior to verification completing. As quick and dirty hack I changed the paymentQueueRestoreCompletedTransactionsFinished: method so that it it polls verifyingCount and waits until verifying count reaches zero before telling the delegate that the restore was completed (the modified code is listed below).

If someone has a better idea let me know

  • (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue
    {
    DLog(@"restore complete");
    self.restoringPurchases = NO;
    if( self.purchaseState == ASTStoreControllerPurchaseStateProcessingPayment )
    {
    // Could be verifying in the background - only update to none state if
    // last known state was processing. Since restoringPurchase flag has been
    // disabled, the finalize transation will deal with resetting state to none.
    self.purchaseState = ASTStoreControllerPurchaseStateNone;
    }

    static void (^restorePollBlock)() = nil;

    if (restorePollBlock == nil) {
    __block id b_self = self;
    __block void (^b_pollBlock)();
    restorePollBlock = [^];
    b_pollBlock = restorePollBlock;
    }

    restorePollBlock();
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant