Skip to main content
Question

Restore Purchases not working with RevenueCatUI – onRestoreCompleted modifier not triggering


Forum|alt.badge.img

I’m using RevenueCatUI and have configured the restore button action correctly in the RevenueCat dashboard. It used to work fine, but recently the onRestoreCompleted modifier is no longer being triggered when I tap the restore button that i configured remotely

 

Here’s the code:
PaywallView(displayCloseButton: false)

    .ignoresSafeArea()

    .onAppear {

        print("paywall onAppear")

    }

    .onDisappear {

        print("paywall onAppear")

    }

    .onPurchaseStarted { package in

        print("onPurchaseStarted")

    }

    .onPurchaseCompleted { transaction, customerInfo in

        print("onPurchaseCompleted")

    }

    .onPurchaseCancelled {

        print("onPurchaseCancelled")

    }

    .onPurchaseFailure { error in

        print("Purchase failed with error: \(error)")

    }

    .onRestoreStarted {

        print("Restore started")

    }

    .onRestoreCompleted { customerInfo in

        print("Restore completed, checking subscription status")

    }

    .onRestoreFailure { error in

        print("Restore failed with error: \(error)")

    }

 

Here’s the Console output:


paywall onAppear

Forum|alt.badge.img+8
  • RevenueCat Staff
  • June 4, 2025

Hi, can you please share with me the SDK version you are using, the code for your restore purchase button, as well as full RevenueCat debug logs for this? You can enable them following our guide here and as this may contain sensitive information I recommend submitting this information via a support ticket here.


Forum|alt.badge.img

Andy Dent
Forum|alt.badge.img+4

I'm doing a hacky workaround for now by creating a timer in .onRestoreStarted and cancelling it in all the other callbacks, in case someone wants a fix a lot sooner than the above PR gets rolled in.

Full code in my comment on 4420.


Forum|alt.badge.img+8
  • RevenueCat Staff
  • June 26, 2025

Hi, it is currently expected behavior for the view modifier only being called if there is something to restore, if there's nothing to restore then it won't be called. You'll see in the console logs something like "Nothing to restore". I have passed back feedback for this to the team and we are looking into possibly creating a new view modifier that gets called for when there's no subscription to restore, no ETA at this time.


Forum|alt.badge.img

Hi Haley, can you ask the devs to review this commit because it solved the issue for me:  https://github.com/RevenueCat/purchases-ios/pull/5253


Reply


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