Implementation of In-app Purchases for iOS Mobile Marketplace Apps

There is a big enough list of mobile app monetization ways to consider. In this article, though, we would like to pay a very special attention to what is called in-app billing integration. Here we share with you our
expertise and the code examples on how to implement an in-app subscription mechanism for
iOS (and partly for Android). Hope this short iOS in-app purchase tech tutorial will serve you great for your mobile marketplace platform development.

The machine behind how in-app purchase works

Being one of the most recognized mobile app monetization methods, in-app
billing functionality requires great attention to the tech details to make
it effective in use. Performance is the core: there lies the answer whether the mobile marketplace platform will be viral or not.

The structure of in-app billing mechanism

You offer one of the several (subscription, freemium, one-time purchase,
etc.) ways to buy your product

>users pay money to get your product and the features it offers

>your tech side of the app is responsible for checking if the user has
subscribed and grants the access to the features offered after the
subscription purchase.

Later, in this article, we will describe the scheme in the form of code.

Creation of the in-app purchase functionality for iOS

Difficulties, challenges, what to remember about

Since we’ve dealt with the development of an app for AppStore, we would
like to describe what were the ups and downs of the process, you might find
useful.

There are two things needed for the mobile in-app purchases:

Developer’s account, where you point out the type of your product a
customer can buy via your app. Here also you fill in all the
required information about your app.

Technical implementation (or simply, the tech stack for your in-app
purchase functionality which is compatible with the technologies
the app is based on). In our case, it’s Cordova, Meteor and React-based app.

The challenges:

If you offer to purchase your own product, you can’t use any other
online payment services integration apart from the one, offered by
Apple (means no PayPal, Stripe, etc.). But in case with the transactions from user to user, it’s allowed.

AppStore withdraws
15%
of the fee based on your net revenue a customer brought you by
subscribing to your mobile marketplace platform app.

Apple offers its own price ranges to choose from (you can’t enter
it manually). The description of the services is declared by Apple
too. It might get quite unusual for some product owners, since the
required info for AppStore might contain commercial details.

To debug or test the product, you have to create a separate test
account which is verified with the app’s ID. If this test account
is anyhow changed it gets immediately deactivated.

Other memo-s when developing in-app purchase subscription functionality for iOS:

Each product has its
unique ID number
by which you can identify your app. There are 2 types of IDs: Team
ID which is generated by Apple and Bundle ID - specified by you.

Apple’s native payment system has its own UI which can’t be
changed;

From all said above, it might seem that Apple makes everything great for
the end user but the developer tools are not flexible enough.

Let’s get to how to implement in-app purchase for iOS

The event-planning online marketplace app we created is JavaScript-based. The tech stack includes such technologies: Cordova, Meteor, React, Mongo In this part we’ll describe how we created the in-app billing for iOS in code.

To make IAP’s work possible, your mobile marketplace platform should communicate
with StoreKit framework. Consider this element as the secured payments
passage, that is responsible for payments secure authorization and
processing.

The first step is to get all packages from you database. We need to keep
information about the packages in our database. Further, we’ll use them for
the registration step in App Store each time the app starts

Bottom line

We hope that the enlighted aspects of this iOS in-app purchase short tutorial will
help you in your project’s endeavours, since the code is the heart of it
all. If you’ve got a plan on how to implement well-thought mobile app
monetization methods but you’re looking for team to bring your B2B and B2C marketplace development plans to
life, you can surely call us for help.