swift- presentCodeDemptionsheet()不起作用

发布于 2025-02-10 07:21:09 字数 374 浏览 2 评论 0原文

我想在应用程序中使用供应代码实现应用程序内购买,我已经在App Store Connect中设置了报价代码,并尝试显示赎回表以供用户输入报价代码。我阅读了一些使用PresentCodeDemptionsHeet()的解决方案。但是,不起作用,床单没有出现。这是我的代码:

@IBAction func applyOfferCodeButtonDidPress(_ sender: Any) {
        if #available(iOS 14.0, *) {
            SKPaymentQueue.default().presentCodeRedemptionSheet()
        }
}

我有一个按钮,单击后,我想显示工作表。 谢谢。

I want to implement in-app purchase with offer code to my app, I have setup the offer code in App Store Connect and try to display the redemption sheet for users to enter the offer code. I read some solutions to use presentCodeRedemptionSheet(). However, is not working, the sheet is not coming up. Here is my code:

@IBAction func applyOfferCodeButtonDidPress(_ sender: Any) {
        if #available(iOS 14.0, *) {
            SKPaymentQueue.default().presentCodeRedemptionSheet()
        }
}

I have a button, after clicked I want to display the sheet.
Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾`听者〃 2025-02-17 07:21:10

在键盘上,Tap 返回右下角上的按钮,而不是完成在上右上的按钮。

On the keyboard tap Return button on the bottom-right corner, not the Done button on the top-right.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文