Skip to content

Paywall v2 .onRestoreCompleted not called #5026

@DavidTiimo

Description

@DavidTiimo

Describe the bug

In the following code snippet the print line will not be called. I have seen many issues here on GitHub and in the community regarding this issue with not much news on it. Some of them have replies from developers saying it was fixed in 5.17.0, but this is not true for me and for others I have seen.

RevenueCatUI.PaywallView(offering: offering, displayCloseButton: true)
 .onRestoreCompleted { _ in
     print("onRestoreCompleted")
 }
  1. Environment
    1. Platform: iOS
    2. SDK version: 5.22.1
    3. StoreKit version:
      • StoreKit 1 (default on versions <5.0.0. Can be enabled in versions >=5.0.0 with .with(storeKitVersion: .storeKit1))
      • StoreKit 2 (default on versions >=5.0.0)
    4. OS version: iOS 18.4
    5. Xcode version: 16.3
    6. Device and/or simulator:
      • Device
      • Simulator
    7. Environment:
      • Sandbox
      • TestFlight
      • Production
    8. How widespread is the issue. Percentage of devices affected.
  2. Debug logs that reproduce the issue. Complete logs with Purchases.logLevel = .verbose will help us debug this issue.
Logs here
  1. Steps to reproduce, with a description of expected vs. actual behavior

Actual

  • Add .onRestoreCompletedto a RevenueCatUI.PaywallView
  • Click restore purchase button
  • Nothing happens

Expected

  • Add .onRestoreCompletedto a RevenueCatUI.PaywallView
  • Click restore purchase button
  • The closure in onRestoreCompleted is called
  1. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

Related:

  1. Additional context
    Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions