Mobile Billing

The Mobile Billing plugin is specifically designed to implement complete native mobile In-App Purchases, In-App Subscriptions and In-App Billing features in both Android and iOS, for games built using Construct 3 and Construct 2.


The Mobile Billing plugin supports all purchases and subscription features, including server-validation.


Earn money with your game and general applications with this complete and easy plugin to integrate payment systems in both Android and iOS.

PlayFab API v2.png

Introduction

Step 1.png

The Construct Master Collection supports the full and easy integration of native mobile Android SDKs and iOS SDKs for both Construct 3 and Construct 2.


Please click here to learn more about Mobile.

Features


The Mobile Billing plugin is specifically designed to implement complete native mobile In-App Purchases, In-App Subscriptions and In-App Billing features in both Android and iOS, for games built using Construct 3 and Construct 2.


The Mobile Billing plugin supports all purchases and subscription features, including server-validation.


Earn money with your game and general applications with this complete and easy plugin to integrate payment systems in both Android and iOS.


Here are some of the native features of the mobile plugin:

  • In-App Billing

  • In-App Purchases

  • In-App Subscriptions

  • Android Billing

  • iOS Store Kit

  • Purchases

  • Subscriptions

  • Redeem promotions

  • Redeem codes

  • Introductory offers

  • Server validation

  • PlayFab validation support

  • Validation URL

  • Manage billing and purchases

  • Manage subscriptions

  • Restore purchases and store

  • Refresh store

  • Advanced purchases

  • Advanced subscriptions

  • Complete product information

  • Complete product transaction receipts

  • Complete purchase transaction information

  • Complete subscription transaction information

  • Native mobile debugging features

  • Well maintained and fully tested for production release.


For more information about native mobile or Android and iOS features, please click here to learn the introductory lessons to Mobile.


Platform Integration


Here are some of the platforms that are natively supported:

  • Android

  • iOS

  • Native Android

  • Native iOS


Build Support


Here are some of the supported build options:


Editor Features


Here are some of the features in the Construct editor:

  • Construct 3

  • Construct 2

 
 

How to use?

It is easy to use the Mobile Billing plugin, you will only need to follow the steps below.

1. The first step is to add the Mobile Billing object into the project.


2. If the Debug property is checked, the plugin will log information and errors in the console for mobile debugging. Set this unchecked for your production release builds.



3. Set the Verbosity plugin property to control the mobile debugging logs.


4. Set the Validator plugin property to choose whether to manually do server validation through receipt validation or opt-out server validation, or to automatically do server validation through a validator url.

 
 

Documentation

 

Actions, Conditions & Expressions

Actions

press to zoom

press to zoom

press to zoom
1/2

The following action groups:

  • General

  • Features

  • iOS

  • Purchase

General

  • Register - Register a product before initialization.

  • Id - The product id from the store.

  • Alias - The optional alias of the product.

  • Type - Choose the type of the product.


  • Initialize - Initialize the mobile billing.


  • Restore - Restore purchases and subscriptions.


  • Refresh - Refresh the store listing.



Features

  • Manage Billing - Shows the billing page of Google Play or the App Store.


  • Manage Subscriptions - Shows the subscriptions page of Google Play or the App Store.



iOS

  • Redeem Promo - Redeems a promotional offer from within the app.



Purchase

  • Purchase - Purchase or subscribe to your app product.

  • Id - The product id or alias.


  • Advanced Purchase (Android) - Purchase or subscribe to your app product, with advanced Android features.

  • Id - The product id or alias.

  • Old SKU - A string with the old subscription to upgrade/downgrade.

  • Proration Mode - The proration mode to apply when upgrading/downgrading a subscription, from the old sku.


  • Advanced Purchase (iOS) - Purchase or subscribe to your app product, with advanced iOS features.

  • Id - The product id or alias.

  • Discount Id - The discount identifier.

  • Discount Key - The discount key identifier.

  • Discount Nonce - The uuid value for the nonce of the discount.

  • Timestamp - The time at which the signature was generated, in milliseconds since epoch.

  • Signature - The cryptographic signature that unlocks the discount.

Conditions

The following condition groups:

  • Init

  • General

  • Purchase

  • Validation

  • Receipt

  • Product

press to zoom

press to zoom

press to zoom

press to zoom
1/3

Init

  • On Initialized - Trigger fires if initialization has completed.


  • Is Initialized - Check if initialization has completed.


  • On Product Registered - Trigger fires when the product is successfully registered.

  • Product Id - The identifier of the product on the store.


  • On Product Register Failed - Trigger fires when the product registration failed.

  • Product Id - The identifier of the product on the store.


  • On Any Product Registered - Trigger fires when a product is successfully registered.


  • On Any Product Register Failed - Trigger fires when a product registration failed.



General

  • On Restore Cancelled - Trigger fires when restoration attempt is cancelled.


  • On Restore Failed - Trigger fires when restoration attempt failed.


  • On Restore Completed - Trigger fires when restoration is completed.


  • On Restore Finished - Trigger fires when restoration has finished, regardless of success, failure or cancellation.


  • On Error - Trigger fires when there is a general error.



Purchase

  • On Purchase Failed - Trigger fires when the purchase or subscribe attempt failed.

  • Product Id - The identifier of the product on the store.


  • On Purchase Succeeded - Trigger fires when the product is successfully purchased or subscribed.

  • Product Id - The identifier of the product on the store.


  • On Purchase Cancelled - Trigger fires when the purchase or subscribe attempt is cancelled.

  • Product Id - The identifier of the product on the store.


  • On Any Purchase Failed - Trigger fires when a purchase or subscribe attempt failed.


  • On Any Purchase Succeeded - Trigger fires when a product is successfully purchased or subscribed.


  • On Any Purchase Cancelled - Trigger fires when a purchase or subscribe attempt is cancelled.



Validation

  • On Product Verified - Trigger fires when the product purchase or subscription is validated.

  • Product Id - The identifier of the product on the store.


  • On Product Unverified - Trigger fires when the product purchase or subscription failed to be validated.

  • Product Id - The identifier of the product on the store.


  • On Any Product Verified - Trigger fires when a product purchase or subscription is validated.


  • On Any Product Unverified - Trigger fires when a product purchase or subscription failed to be validated.



Receipt

  • On Product Receipt - Trigger fires when the product purchase or subscription has received its transaction details, including the receipt.

  • Product Id - The identifier of the product on the store.


  • On Any Product Receipt - Trigger fires when a product purchase or subscription has received its transaction details, including the receipt.



Product

  • On Product Updated - Trigger fires when the product's details were updated.

  • Product Id - The identifier of the product on the store.


  • On Product Owned - Trigger fires when the non-consumable product or subscription is owned.

  • Product Id - The identifier of the product on the store.


  • On Product Refunded - Trigger fires when the product purchase or subscription has been refunded.

  • Product Id - The identifier of the product on the store.


  • On Product Expired - Trigger fires when validation finds the product to be expired.

  • Product Id - The identifier of the product on the store.


  • On Any Product Updated - Trigger fires when a product's details were updated.


  • On Any Product Owned - Trigger fires when a non-consumable product or subscription is owned.


  • On Any Product Refunded - Trigger fires when a product purchase or subscription has been refunded.


  • On Any Product Expired - Trigger fires when validation finds a product to be expired.


  • Is Product Registered - Check if a product is registered or not.

  • Product Id - The identifier of the product on the store.


  • Compare Product Type - Check if a product is consumable, non-consumable or a subscription.

  • Product Id - The identifier of the product on the store.

  • Product Type - The product type to compare with.


  • Is Product Owned - Check if the product or subscription is currently owned, this includes not being expired.

  • Product Id - The identifier of the product on the store.


  • For Each Product - Loops through all registered products.

Expressions

press to zoom

press to zoom

press to zoom

press to zoom
1/3

The following expression groups:

  • General

  • Getters

  • Getters (Transaction)

  • Current

General

  • ErrorMessage - Returns the error message from a recent trigger failure, if any.



Getters

  • Alias - The alias identifier of the product.

  • ProductId - The identifier of the product on the store.


  • Type - Returns the family of product. Either "free subscription", "paid subscription", "non renewing subscription", "consumable" or "non consumable".

  • ProductId - The identifier of the product on the store.


  • Group - Returns the name of the group your subscription product is a member of. (Defaults to "default").

  • ProductId - The identifier of the product on the store.


  • State - Returns the current state of the product. Either "registered", "invalid", "valid", "requested", "initiated", "approved", "finished", "owned", "downloading" or "downloaded".

  • ProductId - The identifier of the product on the store.


  • Title - Returns the localized name or short description.

  • ProductId - The identifier of the product on the store.


  • Description - Returns the localized longer description.

  • ProductId - The identifier of the product on the store.


  • PriceMicros - Returns the price of the product in micro-units. (Divide by 1000000 to get numeric price.)

  • ProductId - The identifier of the product on the store.


  • Price - Returns the localized price, with currency symbol.

  • ProductId - The identifier of the product on the store.


  • Currency - Returns the currency symbol.

  • ProductId - The identifier of the product on the store.


  • CountryCode - Returns the country code. Available only on iOS.

  • ProductId - The identifier of the product on the store.


  • IsLoaded - Returns "True" if the product is loaded, "False" if not.

  • ProductId - The identifier of the product on the store.


  • IsValid - Returns "True" if the product is loaded and validated, "False" if not.

  • ProductId - The identifier of the product on the store.


  • IsPurchasable - Returns "True" if the product is in a state where it can be purchased, "False" if not.

  • ProductId - The identifier of the product on the store.


  • IsOwned - Returns "True" if product is owned, "False" if not.

  • ProductId - The identifier of the product on the store.


  • IsDeferred - Returns "True" if purchase has been initiated but is waiting for an external action (for example, Ask to Buy on iOS), "False" if not.

  • ProductId - The identifier of the product on the store.


  • IntroPrice - Returns the localized introductory price, with currency symbol.

  • ProductId - The identifier of the product on the store.


  • IntroPriceMicros - Returns the introductory price of the product in micro-units (Divide by 1000000 to get numeric price).

  • ProductId - The identifier of the product on the store.


  • IntroPricePeriod - Returns the duration in which the introductory price is available.

  • ProductId - The identifier of the product on the store.


  • IntroToPricePeriodUnit - Returns the unit of measurement of the introductory price period. EIther "Day", "Week", "Month" or "Year".

  • Product Id - The identifier of the product on the store.


  • IntroPricePaymentMode - Returns the payment mode for the introductory price. Either "PayAsYouGo", "UpFront" or "FreeTrial".

  • ProductId - The identifier of the product on the store.


  • IsIneligibleForIntroPrice - Returns "True" when a trial or introductory price has been applied to a subscription. Only available after receipt validation, and only on iOS. Otherwise, "False".

  • ProductId - The identifier of the product on the store.


  • IsDownloading - Returns "True" if product is downloading non-consumable content, "False" if not.

  • ProductId - The identifier of the product on the store.


  • IsDownloaded - Returns "True" if non-consumable product content has been successfully downloaded.

  • ProductId - The identifier of the product on the store.


  • AdditionalData - Returns the additional data possibly required for product purchase.

  • ProductId - The identifier of the product on the store.


  • ExpiryDate - Returns the last known expiry date in timestamp, if a subscription product.

  • ProductId - The identifier of the product on the store.


  • LastRenewalDate - Returns the last renewal date in timestamp, if a subscription product.

  • ProductId - The identifier of the product on the store.


  • BillingPeriod - Returns the duration of the billing period if a subscription product, in units specified by the "BillingPeriodUnit(productId)".

  • ProductId - The identifier of the product on the store.


  • BillingPeriodUnit - Returns the unit of the billing period, if ubscription product. Either "Minute", "Hour", "Day", "Week", "Month" or "Year".

  • ProductId - The identifier of the product on the store.


  • PriceValue - Returns the price of the product.

  • ProductId - The identifier of the product on the store.


  • IntroPriceValue - Returns the introductory price of the product.

  • ProductId - The identifier of the product on the store.


  • Transaction - Returns the transaction data for the latest purchase or subscription of the product, in JSON string.

  • ProductId - The identifier of the product on the store.


  • Discounts - Returns the array of discounts available for the product, in JSON string.

  • ProductId - The identifier of the product on the store.



Getters (Transaction)

  • Receipt - Returns the purchase or subscription receipt of the product, from the latest transaction data.

  • ProductId - The identifier of the product on the store.


  • Signature - Returns the purchase or subscription receipt signature of the product, from the latest transaction data. (Only for Android)

  • ProductId - The identifier of the product on the store.



Current

  • ProductId - Returns the relevant product id, in a trigger.


  • ProductTitle - Returns the title of the relevant product, in a trigger.


  • ProductDescription - Returns the description of the relevant product, in a trigger.


  • ProductPrice - Returns the localized price with currency symbol of the relevant product, in a trigger.


  • ProductCurrency - Returns the currency code of the relevant product, in a trigger.


  • ProductPriceValue - Returns the price value of the relevant product, in a trigger.


  • ProductTransaction - Returns the transaction JSON string of the relevant product purchase or subscription, in a trigger.


  • ProductReceipt - Returns the receipt data of the relevant product purchase or subscription, in a trigger.


  • ProductSignature - Returns the signature of the relevant product purchase or subscription. (Only for Android)

Object   Properties

Plugin Properties

press to zoom

press to zoom
1/1

The following property groups:

  • Configuration

  • Validation

Config - Configure the addon functionality.

  • Debug - If enabled, the addon will log process details for debugging.


  • Verbosity - Define how much you want the Billing SDK to write on the console. Only if debug is enabled.

  • Quiet

  • Error

  • Warning

  • Info

  • Debug


Validation - Configure the validation features of the mobile billing.

  • Validator - If 'Manual', validation will be done manually, e.g. PlayFab or none. Otherwise, if 'URL', validation will be done through the server specified in the validator url.

  • Manual

  • URL


  • Validator URL - The URL of receipt validation service to verify purchases and subscriptions.

 
 

Showcase

The Mobile Billing plugin is specifically designed to implement complete native mobile In-App Purchases, In-App Subscriptions and In-App Billing features in both Android and iOS, for games built using Construct 3 and Construct 2.






 

Game Projects 

Instructions Kit

Construct 3 Project
Construct 3 Project

press to zoom
Construct 2 Project
Construct 2 Project

press to zoom
Construct 3 Project
Construct 3 Project

press to zoom
1/2

Specifications

  • Instructions - The game project contains instructions and steps on how to use the addon and its features.

  • Action, Conditions and Expressions - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks on the recommended ways of using the addon.