How to Add In-App Purchasing To an iPhone, Android or Windows App?

By: Brooke M. Perry

Looking forward to earn money from your newly developed app? The most applicable revenue collection strategy is to release the app as a paid app but this might make many users reluctant towards your app. Next you can try out the most used strategy of making the app free for a particular time and then making it paid for a pro version or a version without ads.

In-app purchase, also known as IAP is the latest strategy available in the market. Through IAP you can make your app available for free but then persuade your users to pay for exclusive privileges like unlocking of new levels, gaining extra features, etc.

To add in-game purchase facility in your app, you don’t require rewriting it in the native code. There are several ways of adding in-app purchase facility to your exciting app. Cloud service called 1 Touch, based on Intel’s mobile development tool - XDK, is one way that will allow you to add in-app purchase ability to an iPhone, Android or Windows app.

Understanding 1 Touch

1Touch is a service of appMobi, which can be accessed through XDK. By integrating the service of 1Touch into your app, you will empower your app to generate a unique ID whenever a user will download your app via any app store. This unique ID will get stored in a digital wallet on the mobile of your user (the downloader).

Next time whenever that user tries to make purchase from inside your app, he has to press the “buy now” button and then that ID will be securely passed to the cloud servers. In the cloud servers, the ID will be verified and then another key will be passed to your (merchant) server. In this way the complete processing of buying will take place.

To get this features integrated into your HTML5 app, you need to do very simple and minimal coding, which have been clearly explained below:

First, you need to add a reference to the 1Touch JavaScript library. For this the following coding will be required:

Next, you need to add the call a function into your IAP button to facilitate the purchasing process. The following code serves the purpose:

function oneTouchPurchase() {‘diam10’,1,paymentSucce


Sometimes, the transaction process might get failed. For this you need to be well prepared for handling the same. The following code helps in handling such transaction errors:

function paymentFail (evt){


of ' + evt.product + ' failed. Please

try later. ','Purchase Not


Transaction errors shouldn’t occur until and unless something goes really wrong. In most of the cases, the transaction takes place successfully and money gets transferred to your account. Finish the coding with the following codes:

function paymentSuccess(product){


alert('Congratulations on your purchase

of ' + product,'Purchase Was


Other important things to be done

The coding for adding in-game purchase is pretty simple. But apart from feeding these codes, you also need to take two more major steps to make the complete process workable.

Create 1Touch app with appMobi Cloud

First you need to create an account with appMobi cloud. After creating the account, you have to create your 1Touch app in appMobi.

Add sale products to your 1touch app

Then, you require adding all your sale items to that 1Touch app. To add your “sale products,” you need to group the products and give a name to the group. This is followed by a few more steps like filling name of the products, its ID, Price, Quantity, and Expiry. Keep a note of the IDs for each individual product, which you will need later on.

Log in to each app store

After getting your apps added to appMobi, you need to log into each app store where you have made your apps available. In the app stores, you have to re-enter the products ID so that the app store can know how to handle payments.

With these steps done, your app will acquire the IAP feature and thus will create a new avenue for revenue collection through your apps. But again there are a few more things you need to take care of such as:

Your app must be capable of IAP restoration in case the user requires reinstalling their device; this is now a requirement for all iOS apps.
You must be ready to pay a commission to each app store for every IAP sale your app makes: Apple and Google charges 30% of commission. For Microsoft its 30% but it drops to 20% if your app receives sales above $25,000.

If the performance of your Android, iOS and Windows app is good, then you can expect to earn good from IAP. In Candy Crush Saga, IAP ranges from 69p to £1.49, while in Clash of Clans it reaches up to £70. So IAP holds huge potential, provided you have an interesting app for your users.

Article Directory:

| More

Hi! I am Brook M. Perry, a prolific blog writer and keen author of articles related to online tablet support and solution for issues related to computers and mobile devices. Being associated with the reputed best pc tuneup service provider Qresolve, I have resolved thousands of tech issues for our customers from worldwide.

Please Rate this Article


Not yet Rated

Click the XML Icon Above to Receive Mobile Articles Articles Via RSS!

Powered by Article Dashboard