Android in-app purchase integration

In-app purchase is a feature through which the application's component can be bought from inside the application with the help of several payment gateways. This is one major aspect of monetization for Android games.

What are in-app purchases?

In the modern day gaming industry, freemium games are booming. This means users can play the game for free, but they have to pay for certain components or for game progression advantages. This model has been proved to be a success, as it supports both free and premium concept in terms of digital gaming.

In-app purchases serve this purpose perfectly. We have already discussed Google In-App Billing services, which is just a means of in-app purchasing through Google. But there are other services that support the same thing.

In general, a game should offer in-app purchase items to give users a choice to buy the following types of content:

  • Unlock certain features in the game
  • Buy certain items to get an advantage over other players
  • Unlock some modes inside the game
  • Increase ease of play
  • Remove annoying advertisements

There are many types of users who have different requirements from the same game with different skillsets. In-app purchase opens up the opportunity for all of them to play the game as per their convenience, and meanwhile, developers make some money.

In-app purchase options

You learned that Google IAB is not the only option for Android in-app purchases. There are a few more that have almost the same features. There are different service types based on the payment methods. Users may not opt for one option to pay, but if several options are given, then it would certainly increase the chance of purchasing.

It is always a good practice to provide the maximum possible options to the user for payments. Several purchase options are required for the following reasons:

  • All users might not have a credit card
  • All users might not have a debit card
  • All users might not have activated net banking
  • All users might not have sufficient talk-time balance
  • All users might not like to directly use real currency

The developer should provide the maximum possible options to overcome these issues and make users use real cash for the game. Currently, available billing services support multiple ways of payment, but we can categorize the services into two major divisions:

  • Store billing services
  • Career billing services

Store billing services

Store billing services are based on the stores from which the user downloads the game. The game should be connected to a store with provided APIs in order to access this feature. We already discussed that Google IAB is a type of store billing service that includes several methods of paying, including credit card, debit card, selective career billing, and so on.

However, Google IAB is not the only store billing service available. The most mentionable store billing, other than Google, is Amazon billing service, which provides almost the same features as Google.

Amazon billing services

Amazon billing service works exactly like Google IAB. However, API and integration is slightly different to Google IAB.

The developer needs to include the com.amazon.device.iap package to integrate Amazon IAP. This process has mainly three components:

  • ResponseReceiver
  • PurchasingService
  • PurchasingListener
ResponseReceiver

Amazon IAP is an asynchronous process. It works as a background service that requires a response receiver to be implemented. The developer needs to declare the receiver in the manifest file.

PurchasingService

The PurchasingService class is used to retrieve various types of information about the user, execute purchases, and notify the Amazon purchasing service about the fulfillment of a purchase.

PurchasingListener

The PurchasingListener interface is used to process asynchronous callbacks from the Amazon server. The application UI thread handles all the callbacks, which is why the developer should keep a check on the running process on the UI thread.

Amazon IAP is similar to Google from a feature and integration point of view. There are other stores that may support their own billing services. There is another option of implementing the developer's own payment portal. However, most developers of Android games prefer to stick to mainstream billing services.

Career billing services

Some game developers use career billing services for monetization. Career billing means the user pays developers for in-app products from their mobile balance, which is managed by the connection provider.

Currently, Google IAB has started supporting career billing within store billing.

Types of in-app purchases

Developers can design their IAP products in three types mainly. These types of products depend on game design and game genre. The types are:

  • Consumable items
  • Non-consumable items
  • Subscription

Consumable items

These items are meant to be consumed within the application. In the case of Google IAB, these products are termed non-managed products.

The billing service provider does not keep track of this consumption by the user. Mostly, in-game currency, power ups, extra life, and so on are the main genres of this type of products. Users can buy the same item multiple times.

Consumable items must be defined on the billing server to make them understandable to the billing service.

Non-consumable items

Non-consumable items are those that do not expire on use. Billing servers keep track of these purchases.

When a user purchases this type of item and uninstalls the application, then upon reinstallation, these purchases can be retrieved. This means the user needs to buy this product only one time throughout the application's life.

Subscriptions

This is a purchase of time or usability of some features inside the application. There are very limited uses for subscription in games. However, this is a good option to provide some feature or services for a limited time or limited use.

Within the span of the duration, the user may not buy the same item, however there is a renewable feature that allows the user to subscribe again for the same thing upon expiration of the service period.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.240.119