Closed emperinter closed 7 months ago
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
Thanks for the report! Could you please attach the complete logs? We can't see any calls to restore in those.
In the mean time, have you considered using the .onPurchaseCompleted
and .onRestoreCompleted
modifiers?
PaywallView()
.onPurchaseCompleted { customerInfo in updateUI(with: customerInfo) }
.onRestoreCompleted { customerInfo in updateUI(with: customerInfo) }
Recovery did not get the user's subscription information
I also tried the onPurchaseCompleted
and onRestoreCompleted
usage you mentioned here, and it prints the following result when restoring the subscription
PaywallView()
.onPurchaseCompleted{customerInfo in
print("Purchases onPurchaseCompleted:\n\(customerInfo)")
fetchCustomerInfoAndUpdateUI()
}
.onRestoreCompleted { customerInfo in
print("Purchases onRestoreCompleted:\n\(customerInfo)")
fetchCustomerInfoAndUpdateUI()
}
.toolbar {
ToolbarItem(placement: .topBarLeading) {
Button(action: {
self.displayPaywall = false
}) {
Image(systemName: "xmark")
.foregroundColor(.black) // Set the image color
}
}
}
.onDisappear(){
fetchCustomerInfoAndUpdateUI()
}
The real ID has been removed from the log
Purchases onRestoreCompleted:
<CustomerInfo:
originalApplicationVersion=1.0,
latestExpirationDate=nil,
activeEntitlements=[:],
activeSubscriptions=[:],
nonSubscriptions=[],
requestDate=2023-12-14 18:37:42 +0000,
firstSeen=2023-12-14 18:36:38 +0000,
originalAppUserId=$RCAnonymousID:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
entitlements=[:]
verification=VerificationResult.notRequested
>
Full Log: revenue_debubg_log.txt
@emperinter There's a bug in StoreKit that doesn't allow you to restore purchases when you load a sandbox app on your device until you make a new purchase, which I think you are experiencing. Unfortunately this is an issue in sandbox. I recommend trying this in TestFlight instead. More info at this blog post.
This issue has been automatically locked due to no recent activity after it was closed. Please open a new issue for related reports.
Describe the bug A clear and concise description of what the bug is. The more detail you can provide the faster our team will be able to triage and resolve the issue. Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.
Environment
usesStoreKit2IfAvailable(true)
)Debug logs that reproduce the issue. Complete logs with
Purchases.logLevel = .verbose
will help us debug this issue.PaywallView
and.presentPaywallIfNeeded
doesn't get the user info either!self.customerInfo = try await Purchases.shared.customerInfo()
, but in reality it's only possible to get the user information via the subscribe button. The code is shown below.Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Additional context Add any other context about the problem here.