diff --git a/RMStore.podspec b/RMStore.podspec index 3e89f892..293d9f3c 100644 --- a/RMStore.podspec +++ b/RMStore.podspec @@ -7,7 +7,7 @@ Pod::Spec.new do |s| s.author = 'Hermes Pique' s.social_media_url = 'https://twitter.com/hpique' s.source = { :git => 'https://github.com/robotmedia/RMStore.git', :tag => "v#{s.version}" } - s.platform = :ios, '7.0' + s.platforms = { :ios => "7.0", :tvos => "9.0", :osx => "10.8" } s.frameworks = 'StoreKit' s.requires_arc = true s.default_subspec = 'Core' diff --git a/RMStore/RMStore.m b/RMStore/RMStore.m index ece43bd9..822d76a6 100755 --- a/RMStore/RMStore.m +++ b/RMStore/RMStore.m @@ -134,6 +134,9 @@ @implementation RMStore { NSMutableDictionary *_products; NSMutableSet *_productsRequestDelegates; + SKProductsRequest *productsRequest; + SKMutablePayment *payment; + NSMutableArray *_restoredTransactions; NSInteger _pendingRestoredTransactionsCount; @@ -210,7 +213,7 @@ - (void)addPayment:(NSString*)productIdentifier } return; } - SKMutablePayment *payment = [SKMutablePayment paymentWithProduct:product]; + payment = [SKMutablePayment paymentWithProduct:product]; if ([payment respondsToSelector:@selector(setApplicationUsername:)]) { payment.applicationUsername = userIdentifier; @@ -239,7 +242,7 @@ - (void)requestProducts:(NSSet*)identifiers delegate.failureBlock = failureBlock; [_productsRequestDelegates addObject:delegate]; - SKProductsRequest *productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:identifiers]; + productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:identifiers]; productsRequest.delegate = delegate; [productsRequest start];