IAPManager icon indicating copy to clipboard operation
IAPManager copied to clipboard

[bugfix] Remove payment callback block when finished.

Open tonycn opened this issue 8 years ago • 2 comments

We're using your payment help tools in out app. Great thanks 😃

tonycn avatar May 06 '16 14:05 tonycn

I think this might remove the wrong object in case of multiple payments. You'd have to reverse the iteration (see removePurchasesChangedCallbackWithContext) to do this correctly. A better way is probably to add the indices to remove to an NSIndexSet and call removeObjectsAtIndexes.

Unless you have huge amounts of purchases, keeping this the way it is now should not really pose a problem, though.

mruegenberg avatar May 07 '16 09:05 mruegenberg

@mruegenberg This bug occurs when the same product are purchased twice. The callback blocks passed on second time will not be called, instead the blocks in the first purchase process are called twice. The completion blocks in self.payments are never be released.

We're showing HUD when purchasing product, the HUD is expected to be dismissed in purchase callback blocks when call "- (void)purchaseProduct:(SKProduct *)product ...". Actually, the blocks passed at the second time will never be called.

Thanks!

tonycn avatar May 07 '16 15:05 tonycn