iOS applications can sell digital products and services using the Store Kit APIs. Products are created and managed in the iTunes Connect portal. Apple manages the transaction processing and approves all products before they can be sold, and charges a fee for each transaction (currently 30%). Apple requires that you use the in-app purchasing for any digital sales in your app, but you cannot use it for sales of physical goods or non-digital services. Apps that offer alternate payment options for digital products and services are likely to be rejected. This document explains how to configure your application to use Store Kit and provides Xamarin.iOS examples of the most common in-app purchasing scenarios.
iOS applications can sell digital products or services using StoreKit – a set of APIs provided by iOS that communicate with Apple’s servers to conduct financial transactions with the user via their Apple ID. The StoreKit APIs are primarily concerned with retrieving product information and conducting transactions – there is no user-interface component. Applications that implement in-app purchasing must build their own user interface and track purchased items with custom code to provide the required products or services to the user.
Providing in-app purchase functionality requires a number of steps:
- Configuring your app –The application’s provisioning profile must be setup correctly.
- Creating products – Product descriptions and prices must be created in the iTunes Connect portal.
- Implementing StoreKit – The StoreKit API must be implemented according to the types of products being sold.
- Building the user interface and the products themselves – The products must be implemented, including mechanisms to track each purchase and backup/restore them if appropriate.
- Monitoring sales and receiving funds – Use information provided by iTunes Connect to monitor sales trends and track your income.
This document explains how to complete all these steps to provide in-app purchases using Xamarin.iOS.
To support In-App Purchasing you must use Xamarin.iOS 5.0 or newer with Xcode 7 and above.
This article has introduced the concept of in-app purchasing, outlined how to configure your application to take advantage of it and presented examples using Xamarin.iOS. It has covered:
- iOS Provisioning Portal – Guidelines for enabling in-app purchase functionality.
- iTunes Connect – Configuring products to sell in your app.
- Store Kit – Explanation of the classes used to build in-app purchase features.
- Coding your app for purchasing – Examples of how to build in-app purchase into a Xamarin.iOS app.
- Reporting – Overview of the statistics available via iTunes Connect.
- In App Purchase Programming Guide
- iTunes Connect Developer Guide
- Store Kit Framework Reference
- In-App Purchase Product Identifiers Q&A
- In-App Purchase Technical Note
- Your First App Store Submission
- App Store Resource Center
- App Store Submission Tips
- App Store Review Guidelines
- Managing Your Apps