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

Retain products request #229

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions RMStore/RMStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ @interface RMStore() <SKRequestDelegate>

@implementation RMStore {
NSMutableDictionary *_addPaymentParameters; // HACK: We use a dictionary of product identifiers because the returned SKPayment is different from the one we add to the queue. Bad Apple.
SKProductsRequest *_productsRequest;
NSMutableDictionary *_products;
NSMutableSet *_productsRequestDelegates;

Expand All @@ -141,7 +142,7 @@ @implementation RMStore {

SKReceiptRefreshRequest *_refreshReceiptRequest;
void (^_refreshReceiptFailureBlock)(NSError* error);
void (^_refreshReceiptSuccessBlock)();
void (^_refreshReceiptSuccessBlock)(void);

void (^_restoreTransactionsFailureBlock)(NSError* error);
void (^_restoreTransactionsSuccessBlock)(NSArray* transactions);
Expand Down Expand Up @@ -239,10 +240,10 @@ - (void)requestProducts:(NSSet*)identifiers
delegate.failureBlock = failureBlock;
[_productsRequestDelegates addObject:delegate];

SKProductsRequest *productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:identifiers];
productsRequest.delegate = delegate;
_productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:identifiers];
_productsRequest.delegate = delegate;

[productsRequest start];
[_productsRequest start];
}

- (void)restoreTransactions
Expand Down