Murl::IAppStoreControl Interface Referenceabstract

The IAppStoreControl interface. More...

#include "murl_i_app_store_control.h"

Inheritance diagram for Murl::IAppStoreControl:

Public Types

enum  Status { STATUS_IDLE, STATUS_CONNECTING, STATUS_CONNECTED, STATUS_ERROR }
 Enumeration of the app-store connection status. More...
 

Public Member Functions

virtual Status GetStatus () const =0
 Get the app-store connection status. More...
 
virtual Bool RegisterProduct (const String &productId, IAppStoreProduct::ProductType productType)=0
 Register a product to the app-store control. More...
 
virtual Bool ConnectToStore ()=0
 Start connecting to the app-store. More...
 
virtual Bool DisconnectFromStore ()=0
 Disconnect from the app-store. More...
 
virtual Bool RestoreTransactions ()=0
 Restore any previously completed purchase transactions. More...
 
virtual UInt32 GetNumberOfAvailableProducts () const =0
 Get the number of available products. More...
 
virtual IAppStoreProductGetAvailableProduct (UInt32 index)=0
 Get a product by index. More...
 
virtual IAppStoreProductGetAvailableProduct (const String &productId)=0
 Get a product by identifier. More...
 
virtual Bool CanPurchaseProducts () const =0
 Check if the app-store allows to purchase products at all. More...
 
virtual Bool PurchaseProduct (IAppStoreProduct *product)=0
 Start purchasing of a product. More...
 
virtual Bool ConsumeProduct (IAppStoreProduct *product)=0
 Consume an already purchased and consumeable product. More...
 
virtual Bool ConfirmConsumedProduct (IAppStoreProduct *product)=0
 Confirm consumption of a consumed product. More...
 
virtual const StringGetLastError () const =0
 Get the description string of the last error. More...
 
virtual Bool ClearLastError ()=0
 Clear the last error status and string. More...
 
- Public Member Functions inherited from Murl::IControlable
virtual const StringGetName () const =0
 Get the controlable's name. More...
 
virtual void FrameUpdate ()=0
 Is executed in the platform thread context each frame tick.
 
virtual void LogicUpdate ()=0
 Is executed in the logic thread context each logic tick.
 
virtual void ConfigChanged (const IAppConfiguration *appConfig)=0
 Notification of changed configuration. More...
 

Detailed Description

The IAppStoreControl interface.

Member Enumeration Documentation

◆ 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.

Member Function Documentation

◆ 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()

virtual Bool Murl::IAppStoreControl::RegisterProduct ( const String productId,
IAppStoreProduct::ProductType  productType 
)
pure virtual

Register a product to the app-store control.

Products can only be registered before calling ConnectToStore() at least once.

Parameters
productIdThe identifier of the product.
productTypeThe type of the product.
Returns
true if successful.

◆ ConnectToStore()

virtual Bool Murl::IAppStoreControl::ConnectToStore ( )
pure virtual

Start connecting to the app-store.

When starting the connnection, the app-store status changes to IAppStoreControl::STATUS_CONNECTING immediately. When the app-store is connected the app-store status changes to IAppStoreControl::STATUS_CONNECTED.

Returns
always true.

◆ DisconnectFromStore()

virtual Bool Murl::IAppStoreControl::DisconnectFromStore ( )
pure virtual

Disconnect from the app-store.

The app-store status changes to IAppStoreControl::STATUS_IDLE immediately.

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.

◆ 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]

virtual IAppStoreProduct* Murl::IAppStoreControl::GetAvailableProduct ( UInt32  index)
pure virtual

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
indexThe zero-based index of the product.
Returns
The product object or null if index is out of range.

◆ GetAvailableProduct() [2/2]

virtual IAppStoreProduct* Murl::IAppStoreControl::GetAvailableProduct ( const String productId)
pure virtual

Get a product by identifier.

The result is only valid after calling ConnectToStore() at least once.

Parameters
productIdThe 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()

virtual Bool Murl::IAppStoreControl::PurchaseProduct ( IAppStoreProduct product)
pure virtual

Start purchasing of a product.

When starting a purchase, the product status changes to IAppStoreProduct::STATUS_PURCHASE_PENDING immediately. The purchase is finished when the product status is IAppStoreProduct::STATUS_PURCHASED.

Parameters
productThe product to purchase.
Returns
true if starting the purchase was successful.

◆ ConsumeProduct()

virtual Bool Murl::IAppStoreControl::ConsumeProduct ( IAppStoreProduct product)
pure virtual

Consume an already purchased and consumeable product.

A product can be consumed if the product type is IAppStoreProduct::PRODUCT_TYPE_CONSUMABLE and the product status is IAppStoreProduct::STATUS_PURCHASED. When starting a consume, the product status changes to IAppStoreProduct::STATUS_CONSUME_PENDING immediately.
The consume is finished when the product status is IAppStoreProduct::STATUS_CONSUMED, see ConfirmConsumedProduct() to finalize the consumption.

Parameters
productThe product to consume.
Returns
true if consuming the product was successful.

◆ ConfirmConsumedProduct()

virtual Bool Murl::IAppStoreControl::ConfirmConsumedProduct ( IAppStoreProduct product)
pure virtual

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
productThe product to confirm consumption.
Returns
true if confirm consumption of the product 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


Copyright © 2011-2018 Spraylight GmbH.