Qt Purchasing

Qt Purchasing is an add-on library that enables Qt applications to support in-app purchases. It is a cross-platform library that currently supports purchases made to the Mac App Store on OS X, App Store on iOS, and Google Play on Android.

In-App Purchases

In-app purchases are a way to monetize an application. These purchases are made from inside the application and can include anything from unlocking content to virtual items. The Qt Purchasing API is built on the system APIs for in-app purchases, which means the purchase process is more familiar to the user, and the information already stored by the platform (such as credit card information) can be used to simplify the purchase process.

快速入门

Qt Purchasing provides C++ classes and QML types to access information about in-app products registered in the external store on the current platform, as well as to request purchases for those products.

The Store

The in-app products must be registered in the target stores, before they can be queried or purchased in an application. We recommend using the same identifiers for the products in each store, as it simplifies the code to query and purchase the products.

Writing the Code

Depending on what fits best with the application, you can choose to use either C++ or QML to support in-app purchasing. If most of the user interface is written in QML, we recommend that you use the QML types, which provide a simple and declarative point of access for the products in the store.

范例

Take a look at the Qt Purchasing Examples for a demonstration on how the APIs can be used in applications.

许可和归属

Qt Purchasing is available under commercial licenses from Qt 公司 。此外,它是可用的在 GNU LGPL (次一般公共许可) 第 3 版 。见 Qt 许可 进一步了解细节。

Furthermore Qt Purchasing on Android contains third party modules under the following permissive licenses:

Base64 Decoder

Apache 许可 2.0

In-app billing service

Apache 许可 2.0

Public Key Verification

Apache 许可 2.0

API 参考