Home / Insights / Mobile App Development

Mobile App Development

In-App Payments and Subscriptions on iOS and Android: StoreKit 2 and Google Play Billing

Selling digital content in a mobile app means working within Apple’s and Google’s billing systems, each with its own concepts, rules and server notifications. This guide explains how to design products, entitlements and backend logic that hold up on both platforms.

TopicsMobile App DevelopmentWeb and SaaS Development

Key takeaways

  • Store rules decide your options first. Apple’s guideline 3.1.1 requires in-app purchase for digital content unlocked in the app, with exceptions for reader apps, multiplatform services and, on the US storefront, external purchase links.
  • StoreKit 2 and Google Play Billing model subscriptions differently: Apple uses subscription groups and levels, Google uses subscriptions with base plans and offers. Design a shared product catalogue that maps cleanly to both.
  • Keep entitlements on your server. Treat the app as a purchase initiator, and let signed transactions, App Store Server API calls, Play Developer API calls and real-time notifications drive access.
  • Handle the unhappy paths deliberately: billing retry and grace periods, account hold, refunds, revocations, upgrades and downgrades, family sharing and restores.
  • Plan library upgrades into your roadmap. Google Play requires Billing Library 8 or later for new apps and updates from 31 August 2026, and both stores keep evolving their APIs.

Subscriptions look simple on a pricing page: monthly, annual, maybe a free trial. Inside a mobile app they are anything but. Each store has its own product model, purchase flow, receipt format, server notifications and review rules, and your backend must reconcile all of them with web sign-ups, promotional access and customer support.

This article is for product owners, CTOs and founders adding paid features to an iOS and Android app, or tidying up a billing implementation that has grown messy. I write as an architect who has to make these systems reliable, so the focus is on decisions and structure rather than code snippets. Billing work sits naturally within our native mobile development practice, where we build iOS apps in Swift and SwiftUI and Android apps in Kotlin and Jetpack Compose, with shared backend services for authentication, APIs and notifications used by both.

What do the store rules allow, and when must you use in-app purchase?

Before choosing APIs, confirm which purchase methods you may use. Getting this wrong leads to rejected releases.

Apple

Apple’s App Review Guidelines state in 3.1.1 that features or content unlocked within an app, including subscriptions, premium content and full-version unlocks, must use in-app purchase. Section 3.1.2 sets subscription rules: auto-renewable subscriptions must provide ongoing value, last at least seven days and be available across the user’s devices, and the app must clearly describe what the user gets for the price. Section 3.1.3 lists exceptions, including reader apps, multiplatform services where content bought elsewhere can be accessed provided it is also available as in-app purchase, and physical goods or services consumed outside the app. The guidelines now also state that on the United States storefront, apps may include buttons, external links or other calls to action to other purchasing methods without a special entitlement; outside the US and other entitled regions, they may not.

Google

Google Play has its own payments policy requiring Google Play’s billing system for in-app digital goods in most cases, with regional programmes for alternative billing. Physical goods and services, such as an e-scooter ride or a food order, use your own payment provider on both platforms.

Regional differences

In the EU, the Digital Markets Act has opened options for alternative distribution and payment on iOS; we covered the implications in alternative app stores and sideloading in the EU. Rules differ by market and change often, so check the current policy text for each storefront you sell in.

What you sellTypical payment routeNotes
Premium features or content used in the appStoreKit / Play BillingCore case for in-app purchase
Physical goods or real-world servicesYour own payment providerFor example Stripe, Adyen or regional gateways
SaaS also sold on the webIn-app purchase plus web sign-upMultiplatform rules apply; entitlements must merge
Reader content (books, video, music)Account access; optional link-out where permittedCheck reader app and regional rules

Action: write down, per storefront, which products must use in-app purchase and where external links are permitted, and have this reviewed before design starts.

How do StoreKit 2 and Google Play Billing model products and subscriptions?

Apple StoreKit 2

According to Apple’s StoreKit overview, StoreKit 2 provides Swift-first APIs built on Swift concurrency for loading products, handling transactions, checking entitlements and offer eligibility, and retrieving the latest subscription status. Transactions are signed by the App Store in JSON Web Signature (JWS) format, and the client APIs return the same information as the App Store Server API, which helps keep app and server consistent. SwiftUI views such as StoreView, ProductView and SubscriptionStoreView can render a merchandising screen with little code, and the APIs let users request refunds and manage subscriptions in the app.

Subscriptions are organised into subscription groups; a user can hold one active subscription per group, and levels within a group define upgrades and downgrades.

Google Play Billing

Google’s subscriptions overview describes a subscription product with one or more base plans (for example monthly and annual) and offers layered on top, such as introductory pricing for new subscribers. Base plans can be auto-renewing, prepaid (users top up to extend access) or, in some countries, installment-based. Purchases must be acknowledged: Google states that unacknowledged purchases are refunded, with a three-day window for plans of a week or longer.

ConceptApple StoreKit 2Google Play Billing
GroupingSubscription group with levelsSubscription with base plans
Introductory pricingIntroductory offersOffers on a base plan
Purchase proofJWS-signed transactionPurchase token
Server APIApp Store Server APIGoogle Play Developer API
Server eventsApp Store Server NotificationsReal-time developer notifications via Cloud Pub/Sub
Plan changesLevel changes within a groupReplacement modes (prorated, deferred and others)
Must confirm purchaseFinish the transactionAcknowledge within the required window

Designing one catalogue for both

Define your products in business terms first: tiers, billing periods, trials and the entitlements each unlocks. Then map them to Apple groups and levels and Google subscriptions and base plans. Keep a single internal entitlement name (for example pro) that both platforms resolve to, so the rest of the app never asks which store a user paid through.

Action: create a product matrix listing each tier, period and offer with its Apple product ID, Google product and base plan IDs, and internal entitlement.

How should you architect entitlements on the server?

The most common billing defect we see is an app that decides access purely on the device. It breaks when users switch devices, sign in on the web, get refunded or contact support.

A server-authoritative design

  1. App initiates purchase through StoreKit 2 or the Play Billing Library.
  2. App sends proof to your backend: the signed transaction on iOS or the purchase token on Android, tied to the signed-in user.
  3. Backend verifies the JWS signature, or calls the Play Developer API to fetch subscription state, and records the purchase.
  4. Backend grants the entitlement and, on Android, acknowledges the purchase if the app has not already done so.
  5. Store notifications keep state current: App Store Server Notifications and Google’s real-time developer notifications report renewals, failures, refunds and cancellations.
  6. App reads entitlements from your API, with a short-lived local cache for offline use.

Treat notifications as triggers, not truth

Google’s real-time developer notifications reference is explicit: notifications only signal that a purchase state changed, and you must call the Play Developer API to get the full status. Notifications include types such as purchased, renewed, in grace period, on hold, cancelled, revoked and expired. It also advises deduplicating messages by ID. Apply the same discipline on iOS: verify signed payloads, make handlers idempotent and reconcile periodically against the server APIs.

Data model essentials

  • Users, with linked store accounts (Apple original transaction ID, Google purchase token lineage).
  • Purchases and subscription periods, with source store, product, status and expiry.
  • Entitlements derived from active purchases, web subscriptions and manual grants.
  • An event log of every notification and verification result for support and audit.

If your iOS and Android apps share business logic, the same entitlement rules can live in shared code; see Kotlin Multiplatform for sharing business logic. The server should remain the source of truth either way.

Action: define the entitlement API and data model before building any paywall screen.

How do you handle the subscription lifecycle and edge cases?

Revenue leaks and support tickets come from lifecycle events, not from the first purchase.

Payment failures

Both stores retry failed renewals. Google describes a grace period, during which the user keeps access while payment is retried, followed by account hold, during which access should be revoked. Apple offers billing retry with an optional billing grace period. Show a clear in-app message asking the user to fix their payment method, and restore access automatically when payment recovers.

Upgrades, downgrades and crossgrades

On Android, replacement modes decide whether a change is immediate and prorated or deferred to the next renewal; Google recommends a prorated charge for upgrades and deferred changes for downgrades. On iOS, moving between levels in a subscription group handles timing. In both cases, invalidate the old purchase on your server so it cannot grant access twice.

Refunds and revocations

Refunds can be issued by the stores without your involvement. Process refund and revocation events promptly and remove entitlements; for consumables, decide how to handle credits already spent.

Restores and multiple devices

Provide a visible restore option, required by Apple for restorable purchases, and link store purchases to user accounts so access follows the user. Decide what happens when one store account is used by two app accounts.

Cancellations and winback

A cancelled subscription usually stays active until period end. Use the time for a respectful retention message, and use store-supported offers rather than custom workarounds.

Web and promotional access

If customers can also subscribe on your website, merge entitlements and prevent double billing by showing current status and where it is managed.

Action: list every lifecycle event for both stores and write the expected entitlement outcome and user message for each.

How do you test billing before release?

Billing bugs are expensive because they affect revenue and trust directly. Test deliberately at three levels.

  1. Local and simulated: Apple supports StoreKit testing in Xcode with configuration files, which lets you simulate purchases, renewals and failures without the network. Use license testers and test tracks on Google Play.
  2. Sandbox end to end: run real flows against Apple’s sandbox and Google’s test environment, with your backend receiving notifications. Accelerated renewal periods help exercise lifecycles quickly.
  3. Production monitoring: after launch, alert on verification failures, notification backlogs, unacknowledged Google purchases and mismatches between store and server state.

Test cases that are often missed

  • Purchase completes while the app is killed or offline.
  • Notification arrives before the app reports the purchase.
  • Duplicate and out-of-order notifications.
  • Upgrade during a free trial; downgrade mid-period.
  • Refund after an entitlement has been used.
  • Grace period expiry and recovery from account hold.
  • Restore on a new device under a different app account.

Store review adds another gate. Paywall wording, restore buttons and subscription disclosures are frequent rejection reasons; our pre-submission checklist for iOS teams covers what reviewers check.

Action: automate the lifecycle tests against your backend’s notification handlers, and run sandbox flows before every billing-related release.

What are the costs, risks and maintenance obligations?

Commercial considerations

Store commission rates vary by programme, product type and subscriber tenure, and change over time, so model them from the stores’ current published terms rather than assumptions. Factor in taxes the stores collect, currency conversion and the price points each store supports.

Maintenance obligations

Billing is not build-once. Google’s Play Billing Library deprecation page describes a two-year deprecation cycle; new apps and updates must use Billing Library 8 or later from 31 August 2026, with extensions available on request until 1 November 2026. Apple introduces StoreKit changes at each annual developer conference. Budget time each year for upgrades.

Build or use a billing platform?

OptionProsCons
Direct integration with both storesFull control, no extra fees, data stays in your systemsMore engineering and maintenance
Third-party subscription platformFaster start, cross-platform dashboards and paywall toolsAdditional fees, dependency on a vendor’s data model
HybridPlatform for receipt handling, own entitlement serviceTwo systems to reconcile

For example, a fitness app with two tiers and a web sign-up might start with a subscription platform to launch quickly, then move entitlement logic in-house once billing becomes central to its business. This is illustrative; the right choice depends on scale, team and how differentiated your billing is.

For monetisation design beyond billing mechanics, our article on creator and fan community apps discusses tiers and paid features.

Implementation checklist

  1. Confirm store rules per storefront and product.
  2. Build the product matrix and internal entitlements.
  3. Implement server verification, entitlement API and notification handlers.
  4. Handle grace periods, account hold, refunds, upgrades and restores.
  5. Test locally, in sandbox and with automated lifecycle tests.
  6. Review paywall copy and disclosures against the guidelines.
  7. Set up monitoring and reconciliation jobs.
  8. Schedule annual library and API upgrades.

Frequently asked questions

Can we avoid store fees by sending users to our website to pay?

Only where the rules allow it. Apple’s guidelines currently permit external purchase links on the US storefront, and some regions have alternative billing programmes, but most digital content unlocked in the app elsewhere must use in-app purchase. Check the current policy for each storefront.

Do we need a backend to sell subscriptions?

Technically a simple app can check entitlements on the device, but a backend is strongly recommended. It lets you verify purchases, handle refunds and renewals through server notifications, support multiple devices and web sign-ups, and give support staff an accurate view.

Should we use StoreKit 2 or the original StoreKit API?

For new work on supported iOS versions, StoreKit 2 is the better fit: Swift concurrency APIs, signed transactions and consistency with the App Store Server API. Older apps may migrate gradually, keeping server-side validation in place throughout.

How do we handle users who subscribe on iOS and then use Android?

Link purchases to a user account on your server. When the user signs in on Android, your entitlement API grants access based on the active iOS subscription. Management and cancellation still happen in the store where they subscribed.

What happens if we miss the Google Play Billing Library deadline?

Existing app versions keep working, but new apps and updates that use a deprecated version are blocked from publishing unless you have an extension. Plan the upgrade a few months ahead.

How long does a billing implementation take?

It depends on the number of products, platforms, web billing integration and lifecycle cases you need to support. We usually start with a short technical requirements review to map products and edge cases, which gives a realistic estimate.

Sources and methodology

Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.

  1. Apple: App Review Guidelines (section 3.1 Payments) — accessed 9 November 2026. In-app purchase requirements, subscription rules, exceptions and the US storefront external link allowance.
  2. Apple Developer: StoreKit — accessed 9 November 2026. StoreKit 2 Swift APIs, JWS-signed transactions, StoreKit views, App Store Server API and testing in Xcode.
  3. Android Developers: Google Play Billing subscriptions overview — accessed 9 November 2026. Base plans and offers, renewal types, acknowledgement windows, replacement modes, grace period and account hold.
  4. Android Developers: Real-time developer notifications reference — accessed 9 November 2026. Pub/Sub delivery, subscription notification types, and the need to call the Play Developer API for full state.
  5. Android Developers: Play Billing Library deprecation FAQ — accessed 9 November 2026. Two-year deprecation cycle and the 31 August 2026 requirement for Billing Library 8 or later.

Is your app’s subscription logic ready for both stores?

We can review your billing implementation, map products and lifecycle events, and design a server-side entitlement model for iOS and Android.