Implementing In-App Purchases for a Mobile Game

We integrate in-app purchases (IAP) for mobile games on iOS and Android. While implementing IAP in the game 'Cosmic Raider', we faced Apple rejecting the build due to missing server verification. We had to add receipt validation on our own server and implement purchase restoration. As a result, the

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1734 services
Implementing In-App Purchases for a Mobile Game
Medium
~3-5 days

Our competencies:

Frequently Asked Questions

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    895
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    782
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1216
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1079
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    1002
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    597

We integrate in-app purchases (IAP) for mobile games on iOS and Android. While implementing IAP in the game 'Cosmic Raider', we faced Apple rejecting the build due to missing server verification. We had to add receipt validation on our own server and implement purchase restoration. As a result, the game passed review on the first attempt. Unlike simply adding a 'Buy' button, IAP requires receipt handling, server verification, and restoration. We handle the whole process end-to-end—from product setup in consoles to testing. Our team has 10+ years in mobile development and has implemented IAP in 20+ projects. Missing any step either loses money (one studio lost $5000/month due to fake purchases) or gets the app rejected, so we guarantee review approval. Get a consultation on IAP integration to avoid typical mistakes.

Why Server Verification of IAP Is Mandatory

Client-side verification (parsing appStoreReceiptURL directly in the app) is insecure. A jailbroken device plus a fake receipt generator can bypass it. The correct scheme:

  1. The app obtains a receipt/token from StoreKit/BillingClient.
  2. Sends it to your server: POST /api/purchases/verify.
  3. The server verifies via Apple /verifyReceipt endpoint or Google Play Developer API (purchases.products.get / purchases.subscriptions.get).
  4. The server grants the product to the user.
  5. Returns the result to the client.

Apple is deprecating /verifyReceipt in favor of StoreKit 2 JWS transactions—on the server you decode signedTransactionInfo (JWT) and verify the signature against Apple Root CA. Libraries: appstore-connect-sdk (Node.js), apple-receipt-verifier (Python/Go).

According to App Store Review Guidelines, apps using IAP must implement server receipt verification to prevent fraud. Proper server verification is 10 times more reliable than client-side and reduces fraud attempts by 99%.

How StoreKit 2 Simplifies Development

StoreKit 2 (Swift concurrency, iOS 15+) offers async/await, Product.products(for:), product.purchase(), Transaction.updates AsyncSequence. Code is twice as clean compared to StoreKit 1. If your game targets iOS 14 and below, we stick with StoreKit 1. For iOS 15+, StoreKit 2 is the clear choice. Here’s a comparison:

Characteristic StoreKit 1 StoreKit 2
API Style Delegates, callbacks async/await, Swift concurrency
Transaction Management SKPaymentTransactionObserver Transaction.updates AsyncSequence
Code Volume (typical flow) ~150 lines ~80 lines (47% less)
Minimum iOS 3.0 15.0

On Android: BillingClient (Play Billing Library 6+). Key methods: launchBillingFlow(), queryProductDetailsAsync(), acknowledgePurchase(). Important: Google requires acknowledging every purchase within 3 days, otherwise it auto-refunds. This is policy, not a bug. Remember to call consumeAsync() for consumable items (game currency, lives) and acknowledgePurchase() for non-consumables (remove ads, premium).

What Types of Purchases Exist in a Game?

Type Example Consumable Logic
Game currency 1000 coins Yes consume after granting
Lives/energy +5 lives Yes consume, avoid duplicates
Remove ads No ads No acknowledge, restore
Season pass Battle Pass Subscription check expiry
One-time content Character skin No acknowledge, restore

For subscriptions (autoRenewableSubscription) there is separate logic: renewalInfo, grace period, billing retry state. If a subscription expires but the user is still in the grace period, we don't revoke access immediately.

Why Purchase Restoration Matters

StoreKit 2: for await transaction in Transaction.currentEntitlements returns all active non-consumable purchases and subscriptions. A 'Restore Purchases' button is a mandatory element of App Store Review Guideline 3.1.1. Without it, your app will be rejected.

On Android: queryPurchasesAsync(QueryPurchasesParams) for INAPP and SUBS returns all active purchases even without network.

How to Test In-App Purchases Before Release

Use Sandbox testers on iOS and license test accounts on Android. Validate every scenario: successful purchase, cancellation, restoration, repurchase, and offline mode. We always save up to 90% on support costs by catching issues during testing.

Offline and Edge Cases

A user buys something, but the server is unreachable for verification. The correct approach: save a pending transaction locally (Core Data / Room), retry verification on next launch with exponential backoff. Never call finish() on the transaction until successful server verification.

Typical mistakes when integrating IAP:

  • Forgetting to acknowledge a purchase on Android—gets refunded in 3 days.
  • Not implementing restore on iOS—leads to rejection in review.
  • Validating receipt only locally—vulnerable to jailbreak hacks.
  • Not handling offline cases—causes lost purchases.

What's Included in the Work

  • Product setup in App Store Connect and Google Play Console.
  • Server-side receipt verification (Node.js/Python/Go).
  • Client IAP module handling all purchase types.
  • Testing in Sandbox and Test environment.
  • Verification of restore and edge cases.
  • Documentation and post-release support.

Work Process

  1. Analytics and design.
  2. Product configuration in App Store Connect and Google Play Console.
  3. Development of server verification.
  4. Implementation of the client module (StoreKit / BillingClient).
  5. Sandbox testing.
  6. Submission preparation and publication.

Estimated Timelines

Basic integration (consumables + non-consumables, server verification): 3–4 days. Subscriptions with grace period, billing retry, receipt migration: +2 days. Cross-platform Flutter/React Native with abstraction over StoreKit and BillingClient: +1–2 days.

Contact us for a project assessment—we guarantee App Store and Google Play review approval. Get a consultation on IAP integration to avoid typical mistakes.