Reputation: 113
I am creating offer codes with auto-renewable In-app purchases in swift. But when i use presentCodeRedemptionSheet(), it does not show any redemption page to redeem offer code. I am using below code, but nothing is happening on tapping the button.
let paymentQueue = SKPaymentQueue.default()
if #available(iOS 14.0, *) {
DispatchQueue.main.async {
paymentQueue.presentCodeRedemptionSheet()
}
}
Upvotes: 2
Views: 3010
Reputation: 902
I had the same issue. For me the problem was that the device was not signed in to the app store. To fix it, I tapped on "restore purchases" in the app which caused iOS to prompt me for an Apple ID. Once signed in, presentCodeRedemptionSheet()
causes the expected UI to display.
Upvotes: 0
Reputation: 1178
Are you trying on the simulator?
This command only works on a real device not in the simulator.
Upvotes: 4