Skip to main content
Question

Purchase package works, but completion block never fires?


Forum|alt.badge.img

Hello. For the life of me, I cannot get the completion block to fire when making a purchase. Purchases all have gone through successfully but RevenueCat is not letting me know so that I can do post-transaction clean-up. 

[[RCPurchases sharedPurchases] purchasePackage:package withCompletion:^(RCStoreTransaction *transaction, RCCustomerInfo *customerInfo, NSError *error, BOOL cancelled) {

NSLog(@"SUBSCRIPTION PURCHASED");

 }];

Notes: 

  • Running iOS 17.0.1 (have tried 15 as well).
  • Testing in sandbox, multiple devices.
  • Have created new sandbox user(s), logged out of device, deleted app, restarted device, restarted Xcode, cleaned build folder. Several times.
  • Using Objective C. 
  • Completion block for getOfferings and restorePurchases does work properly.  

I know I’m new to RevenueCat, but everything else seems to be working fine, all except this all-important feature. Any assistance or insight on this would be greatly appreciated. Thanks!

 

This post has been closed for comments

4 replies

Forum|alt.badge.img+1
  • New Member
  • 2 replies
  • October 12, 2023

Hi, 

i have the exact same issue, 

the callback of purchase package is never called

   [[RCPurchases sharedPurchases] purchasePackage:offerings.current.annual withCompletion:^(RCStoreTransaction *transaction, RCCustomerInfo *customerInfo, NSError *error, BOOL cancelled) 
{

}

BUT, if I add this line before

   RCPurchases.sharedPurchases.finishTransactions = false;

the callback is called.

try on your side to check if we have the same issue.

Thanks


Forum|alt.badge.img
  • Author
  • New Member
  • 3 replies
  • October 12, 2023

Yes, adding RCPurchases.sharedPurchases.finishTransactions = false; allows the completion block code to execute. (However, I really wanted RevenueCat to do all the lifting here, and I do not plan on setting up a server to handle finishing the transaction.) 

Looking forward to hearing if RC support has any insight into this...


Forum|alt.badge.img+8
  • RevenueCat Staff
  • 581 replies
  • October 24, 2023

Hi, while this isn't proper behavior, it's not uncommon to see weird behavior in the sandbox environment.  Can you provide me with a couple of things here so we can investigate this:

  • Can you let me know what language/version of our SDK you are using? 
  • Could you please send verbose debug logs for this? You can do this by changing it from RCLogLevelDebug to RCLogLevelVerbose.

Also, with this you won’t want to call  RCPurchases.sharedPurchases.finishTransactions = false as setting this value to false will prevent the SDK from finishing transactions and you would then need to finish transactions in your app yourself.


Forum|alt.badge.img+1
  • New Member
  • 2 replies
  • October 26, 2023

thanks for your message, I have found the issue, I had this line in my appdelegate

 

[[SKPaymentQueue defaultQueue] addTransactionObserver:[InAppRageIAPHelper sharedHelper]];

 

removing this line fixed the issue.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings