Skip to main content
Question

restoreCompleted/restoreFailure doesn't trigger in PaywallFooter


Forum|alt.badge.img+4

I have added a `paywallFooter` to my SwiftUI screen and it seems to be working fine.

However, I have noticed that the `restoreCompleted` and `restoreFailure` callbacks are not getting triggered. I have observed that the `restoreStarted` callback is getting triggered when the user clicks on the "Restore Purchase" button, but the other callbacks do not seem to be working.

.paywallFooter(
      fonts: CustomPaywallFontProvider(fontName: FontFamily.ZenMaruGothic.medium.name),
      purchaseCompleted: { customerInfo in
         // Triggers as expected
      },
      restoreStarted: {
         // Triggers as expected
      },
      restoreCompleted: { _ in
         // Doesn't work
      }, restoreFailure: { _ in
         // Doesn't work
      }
    )

 

I can see that the restore logic is successful based on the console log, but nothing appears on the screen upon completion, resulting in a poor experience for customers.


Could you please help me?

5 replies

Forum|alt.badge.img+8
  • RevenueCat Staff
  • 430 replies
  • March 27, 2024

Hi, I’d be happy to help with this. Can you let me know the language and version of our SDK you are using? Additionally, can you please enable debug logs and go through the restore purchase flow to see if there are any errors being thrown with the callbacks? You can enable them by following this guide.  


Forum|alt.badge.img+8
  • RevenueCat Staff
  • 430 replies
  • April 10, 2024

Hi @Goktug Gumus so sorry, it appears the post closed before you could respond. It is now open again. Are you still experiencing this issue? If so can you please provide the information I asked for the in the previous reply?  


Forum|alt.badge.img+5
  • New Member
  • 1 reply
  • May 28, 2024

Hello Haley, I’m experiencing this issue. Can you help me please?
 

    func paywallViewController(_ controller: PaywallViewController, didFinishRestoringWith customerInfo: CustomerInfo) {

        if customerInfo.activeSubscriptions.isEmpty {

            showAlertMessage(title: "Failed", message: "No purchases found to restore.")

            return

        }

    }

    

    func paywallViewControllerDidStartRestore(_ controller: PaywallViewController) {

        showAlertMessage(title: "Failed", message: "No purchases found to restore.")

    }

    

    func paywallViewController(_ controller: PaywallViewController, didFailRestoringWith error: NSError) {

        showAlertMessage(title: "Failed", message: "No purchases found to restore.")

    }

    Non of these callbacks are working. But didFinishPurchasingWith works perfectly
I’m currently using the latest version of the iOS SDK and using UIKit to show the paywall


Forum|alt.badge.img+3
  • Dedicated Member
  • 17 replies
  • August 19, 2024

No one has followed up on this? What is the solution? I do not get a restore callback (failure or success) either when testing with a sandbox account set in the Settings App > App Store on a real device.


  • New Member
  • 1 reply
  • August 26, 2024

I have this exact same issue using the SwiftUI Paywall View.

 

            .onRestoreStarted {

                print("πŸ’° This will get called for both the Simulator and a physical device.")

            }

            .onRestoreFailure { _ in

                print("πŸ’° This will only work in the Simulator, not on a real device.")

            }

            // called by hitting Restore button

            .onRestoreCompleted {

                print("πŸ’° This will ONLY get called if Restore was successful.  Found an Active Subscription or they tried to purchase a Subscription and an Active one was found.")

            }


Why is it that RC will give a valid Success dialog on a Restore that works but then fails to show anything if it doesn’t work?  Very odd.


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