In-App Purchases (Consumable) for iOS

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
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 1 servicesAll 1735 services
In-App Purchases (Consumable) for iOS
Medium
~2-3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

iOS In-App Purchases Implementation (Consumable)

Consumable IAP — coins, crystals, lives, charges — purchases that spend and buy again. Unlike non-consumable, Apple does not restore them: coins purchased and spent a year ago cannot be returned via restoreCompletedTransactions. Virtual currency balance is entirely developer's responsibility.

Main Problem: Double Crediting

Consumable transaction must be processed exactly once. Most common bug — credit currency in paymentQueue(_:updatedTransactions:) and call finishTransaction in same method. If app crashes after crediting but before finishTransaction — Apple re-delivers transaction on next launch, and user gets coins twice.

Correct order with server architecture:

  1. Get transaction in .purchased state
  2. Send transactionIdentifier + receipt to your server
  3. Server idempotently credits currency (checks transactionIdentifier in DB — if exists, doesn't credit again)
  4. After successful server response — finishTransaction

Without idempotency on server double crediting on crash or unstable network is inevitable.

StoreKit 2 and Consumables

In StoreKit 2 consumable transactions don't appear in Transaction.currentEntitlements — because they have no "active" state. They appear in Transaction.all (full history), but only after finish() if transactionID known.

let result = try await product.purchase()
if case .success(let verification) = result,
   case .verified(let transaction) = verification {
    // Send to server for crediting
    let credited = await creditOnServer(transactionId: transaction.id,
                                         receiptData: receiptData)
    if credited {
        await transaction.finish()
    }
    // If server unavailable — don't finish,
    // transaction comes again on next launch
}

Offline Scenario

For games without permanent backend — local balance storage in Keychain with server verification on next online session. In this case don't finish transaction until confirmation. But if user never goes online — need timeout and local fallback, otherwise App Review rejects (guideline 3.1.1 requires purchased content be accessible).

Testing Edge Cases

In Xcode StoreKit Testing (StoreKitTest framework) can simulate transaction failures:

let session = try SKTestSession(configurationFileNamed: "Products")
session.simulateAskToBuyInSandbox = false
// Force error for testing retry logic
try session.failTransactionsEnabled = true

Must cover: purchase with no internet, crash between crediting and finish(), restart after crash, attempt to buy with already unfinished transaction in queue.

Timeline — 2–3 days: StoreKit 2 integration, server part with idempotent crediting, Sandbox tests.