Class InAppBillingClient


  • public class InAppBillingClient
    extends Object

    The InAppBillingClient handles the retrieval of products that were created for your mobile application in the Android and iOS marketplaces. The client works very closely with the In-App Billing service in Gluon CloudLink. Make sure that you have properly set up everything on the In-App Billing page in Gluon Dashboard before you start testing the In-App Billing client on your device.

    Note: The InAppBillingClient uses the InAppBillingService for handling the platform specific details of in-app billing. Therefore, make sure that the in-app-billing plugin has been enabled in your Gluon Mobile application build configuration:

    
        <dependency>
            <groupId>com.gluonhq.attach</groupId>
            <artifactId>in-app-billing</artifactId>
            <version>${attach.version}</version>
        </dependency>
        ...
        <plugin>
          <groupId>com.gluonhq</groupId>
          <artifactId>client-maven-plugin</artifactId>
          <version>${client.plugin.version}</version>
          <configuration>
            <attachList>
              <list>in-app-billing</list>
            </attachList>
          </configuration>
        </plugin>
     
    Since:
    4.4.0
    • Constructor Detail

      • InAppBillingClient

        public InAppBillingClient()
    • Method Detail

      • registerProducts

        public void registerProducts()
        Registers the products that are configured for your Gluon Mobile application in Gluon CloudLink. This method needs to be called in order to be able to populate the list of products and already purchased product orders onto the mobile device.
      • getProducts

        public ObservableList<Product> getProducts()
        Returns a list of products with their details. The information that is held in each product is retrieved from the respective marketplace. The list will not be populated until a call to registerProducts() has been made.
        Returns:
        a list of registered products in the platform's marketplace
      • getProductOrders

        public ObservableList<ProductOrder> getProductOrders()
        Returns a list of product orders that were made for the active account on the device. The list will not be populated until a call to registerProducts() has been made.
        Returns:
        a list of registered products in the platform's marketplace