Skip to content

Successful restore notification happening before verification completes #17

@Ghirigoro

Description

@Ghirigoro

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();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions