Skip to main content
Question

restoreCompleted/restoreFailure doesn't trigger in PaywallFooter

  • 22 March 2024
  • 5 replies
  • 57 views

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

Userlevel 4
Badge +8

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.  

Userlevel 4
Badge +8

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?  

Badge +5

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

Badge +3

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.

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