Question

restoreCompleted/restoreFailure doesn't trigger in PaywallFooter

  • 22 March 2024
  • 3 replies
  • 42 views

Badge +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?


3 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

Reply