The IAppStoreControl interface.
More...
#include <murl_i_app_store_control.h>
◆ Status
Enumeration of the App Store connection status.
Use GetStatus() to get the current status.
Enumerator |
---|
STATUS_IDLE | The connection is idle.
|
STATUS_CONNECTING | Connecting to the App Store is in progress.
|
STATUS_CONNECTED | The connection to the App Store is established.
|
STATUS_ERROR | Connection error.
|
◆ GetStatus()
virtual Status Murl::IAppStoreControl::GetStatus |
( |
| ) |
const |
|
pure virtual |
Get the App Store connection status.
The connection operation works asynchronously, the application can check the current status to operate correctly.
- Returns
- The App Store connection status.
◆ RegisterProduct()
Register a product to the App Store control.
Products can only be registered before calling ConnectToStore() at least once.
- Parameters
-
productId | The identifier of the product. |
productType | The type of the product. |
- Returns
- true if successful.
◆ ConnectToStore()
virtual Bool Murl::IAppStoreControl::ConnectToStore |
( |
| ) |
|
|
pure virtual |
◆ DisconnectFromStore()
virtual Bool Murl::IAppStoreControl::DisconnectFromStore |
( |
| ) |
|
|
pure virtual |
◆ ReconnectToStore()
virtual Bool Murl::IAppStoreControl::ReconnectToStore |
( |
| ) |
|
|
pure virtual |
Reconnect to the App Store.
This method is basically identical to calling DisconnectFromStore() followed by a call to ConnectToStore(), except that the internal status of the registered products is not touched. Can be used in a logic implementation when e.g. the app run state changes to APP_RUN_STATE_RUNNING, to refresh the store connection.
- Returns
- always true.
◆ RestoreTransactions()
virtual Bool Murl::IAppStoreControl::RestoreTransactions |
( |
| ) |
|
|
pure virtual |
Restore any previously completed purchase transactions.
To successfully restore any previous transactions, the current status must be IAppStoreControl::STATUS_CONNECTED.
- Returns
- true if successful.
◆ SwitchAppStoreImplementation()
virtual Bool Murl::IAppStoreControl::SwitchAppStoreImplementation |
( |
SInt32 |
id | ) |
|
|
pure virtual |
Switch to a different variant of the app store controller implementation.
Can be used to switch between different implementations for quality testing. Current only implemented for the Google Play Store: Use parameter id 1 for the Google Play Billing Library version 3 (new version) Use parameter id 0 for the InAppBillingService version 3 (old version)
- Parameters
-
id | The identifier of the implementation. |
- Returns
- true if successful.
◆ GetNumberOfAvailableProducts()
virtual UInt32 Murl::IAppStoreControl::GetNumberOfAvailableProducts |
( |
| ) |
const |
|
pure virtual |
Get the number of available products.
The result is only valid after calling ConnectToStore() at least once.
- Returns
- The number of available products.
◆ GetAvailableProduct() [1/2]
Get a product by index.
The result is only valid after calling ConnectToStore() at least once. A valid product index is [0 .. GetNumberOfAvailableProducts() - 1].
- Parameters
-
index | The zero-based index of the product. |
- Returns
- The product object or null if index is out of range.
◆ GetAvailableProduct() [2/2]
Get a product by identifier.
The result is only valid after calling ConnectToStore() at least once.
- Parameters
-
productId | The identifier of the product. |
- Returns
- The product object or null if the identifier is not found.
◆ CanPurchaseProducts()
virtual Bool Murl::IAppStoreControl::CanPurchaseProducts |
( |
| ) |
const |
|
pure virtual |
Check if the App Store allows to purchase products at all.
The result is only valid after calling ConnectToStore() at least once.
- Returns
- true if in-app purchasing is possible.
◆ PurchaseProduct()
◆ ConsumeProduct()
◆ ConfirmConsumedProduct()
Confirm consumption of a consumed product.
If a product has the status IAppStoreProduct::STATUS_CONSUMED the consumption of the product must be confirmed. When confirming the consumption, the product status changes to IAppStoreProduct::STATUS_NOT_PURCHASED immediately and the product's receipt data is emptied.
- Parameters
-
product | The product to confirm consumption. |
- Returns
- true if confirm consumption of the product was successful.
◆ TryCancelProduct()
Try to cancel an already purchased product.
This method can be used in a test (sandbox) environment to try to cancel a previously purchased product. Note: Currently this only works for the Google Play store when using a test account; on all other platforms this method simply returns false.
- Parameters
-
product | The product to cancel. |
- Returns
- true if cancelling was successful.
◆ GetLastError()
virtual const String& Murl::IAppStoreControl::GetLastError |
( |
| ) |
const |
|
pure virtual |
Get the description string of the last error.
Use ClearLastError() to reset the error status.
- Returns
- The description string of the last error.
◆ ClearLastError()
virtual Bool Murl::IAppStoreControl::ClearLastError |
( |
| ) |
|
|
pure virtual |
Clear the last error status and string.
Set the connection status IAppStoreProduct::STATUS_ERROR to IAppStoreProduct::STATUS_CONNECTED or IAppStoreProduct::STATUS_IDLE.
Clear the last error string.
- Returns
- true if successful.
The documentation for this interface was generated from the following file:
- murl_i_app_store_control.h