Demo iOS Classes | Qt 6.12
Description: IOS classes are used in the purchasing demo to enable purchasing in iOS.

- Qt 6.12
- Demo iOS Classes
- Qt 6.12.0 Reference Documentation

# Demo iOS Classes

## Classes

IosInAppPurchaseProduct | A product registered in the store.
IosInAppPurchaseTransaction | Contains information about a transaction in the external app store.
IosInAppPurchaseBackend | Comminucates with external store.

Check out Base Classes which include InAppProduct, InAppStore, InAppTransaction and InAppPurchaseBackend

## IosInAppPurchaseProduct

IosInAppPurchaseProduct adds purchase() for initializing purchasing process.

## IosInAppPurchaseTransaction

IosInAppPurchaseTransaction adds new parameters and return types. Transaction error handling is implemented on IosInAppPurchaseTransaction's constructor. The class has the finalize() function that finalizes the transaction.

## IosInAppPurchaseBackend

IosInAppPurchaseBackend uses Objective-C language to communicate with the App Store.

### Initializing the products

This class shows the product's information on the store page.

1. IosInAppPurchaseBackend is called from InAppStore::setupBackend().
2. At initialization IosInAppPurchaseBackend creates InAppPurchaseManager with Objective-C.
3. InAppStore::registerProduct(productType, &identifier) function is called and queryProduct() is executed in the back end.
4. Objective-C function requestProductData:() is called and will make SKProductRequest.
5. After SKProductRequest is finished and product objects has been created in Objective-C productsRequest:(), products will be registered by the IosInAppPurchaseBackend::registerProduct() function.
6. Signal productQueryDone() will be emitted and the item's information will be visible on the application's store page.

### Purchasing process

1. The user presses one of the products on the applications store page.
2. `IosInAppPurchaseProduct::purchase()` function is called and payment is added to the `SKPaymentQueue` in the Objective-C function paymentQueue:() in IosInAppPurchaseBackend.
3. Purchase confirmation pop-up is launched for the user.