iOS 课堂演示
类别
IosInAppPurchase 产品 | 在商店中注册的产品。 |
IosInAppPurchaseTransaction 交易 | 包含外部应用程序商店中的交易信息。 |
IosInAppPurchaseBackend | 与外部商店通信。 |
查看基类,包括 InAppProduct、InAppStore、InAppTransaction 和 InAppPurchaseBackend
IosInAppPurchaseProduct
IosInAppPurchaseProduct 添加了用于初始化购买流程的 purchase()。
IosInAppPurchaseTransaction
IosInAppPurchaseTransaction 增加了新参数和返回类型。交易错误处理在 IosInAppPurchaseTransaction 的构造函数中实现。该类具有 finalize() 函数,可最终确定事务。
IosInAppPurchaseBackend
IosInAppPurchaseBackend 使用Objective-C语言与 App Store 通信。
初始化产品
该类在商店页面上显示产品信息。
- IosInAppPurchaseBackend 由 InAppStore::setupBackend() 调用。
- 初始化时,IosInAppPurchaseBackend 会使用 Objective-C 创建 InAppPurchaseManager。
- 调用 InAppStore::registerProduct(productType, &identifier) 函数并在后端执行 queryProduct()。
- 调用 Objective-C 函数 requestProductData:(),提出SKProductRequest。
- 在 SKProductRequest 完成并在 Objective-C 的 productsRequest:() 中创建产品对象后,产品将通过 IosInAppPurchaseBackend::registerProduct() 函数注册。
- 将发出 productQueryDone() 信号,并在应用程序的商店页面上显示商品信息。
购买流程
- 用户点击应用程序商店页面上的产品之一。
IosInAppPurchaseProduct::purchase()
在 IosInAppPurchaseBackend 中的 Objective-C 函数 paymentQueue:() 中,将调用该函数并将付款添加到 。SKPaymentQueue
- 向用户弹出购买确认窗口。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.