In-Game Shop: IAP Integration, Virtual Currency & Cashback

TRUETECH 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 1All 1734 services
In-Game Shop: IAP Integration, Virtual Currency & Cashback
Medium
~5 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    859
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    746
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1162
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1035
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    969
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    563

The in-game shop is the central point of mobile payments in a game. A player opens it with the intent to spend. The implementation goal: don't obstruct that intent with technical issues and make the purchase process as simple as possible. A typical problem is desynchronisation between client and server after a purchase—when the player pays but the item is not delivered. The solution: idempotent transactions and server-side receipt validation. We use server-side validation that is 100 times more reliable than client-side checks, with idempotency by transactionId, completely eliminating lost purchases. Over 5 years we have implemented shops for 15+ games, achieving an average revenue increase of 30%. One case: a game with monthly subscription—after introducing personalised offers, revenue grew by 45% in 2 months. Meanwhile, chargeback rate dropped by 20% saving an average of $5,000 per month. 97% of transactions complete without errors, average processing time under 2 seconds. Total processed transactions exceed 2 million.

How the Product Catalogue Works

The shop catalogue is stored on the server—no hardcoded prices or items on the client. This allows changing offers without an app update, running A/B tests, and launching promotions in real time.

Product structure example:

{
  "productId": "gems_pack_medium",
  "type": "iap_consumable",
  "storeProductId": {
    "ios": "com.mygame.gems.500",
    "android": "gems_500"
  },
  "displayName": "500 Crystals",
  "description": "Plus 50 bonus crystals",
  "gemAmount": 500,
  "bonusGemAmount": 50,
  "badge": "best_value",
  "position": 2,
  "isVisible": true
}

storeProductId differs for iOS and Android because product IDs in App Store and Google Play are independent. The client selects the appropriate one by platform when displaying.

Platform StoreKit / Billing Language Product ID format
iOS StoreKit 2 (Swift) Swift 5.9+ com.company.productid
Android Google Play Billing Library 6 Kotlin/Java productid_with_underscores
IAP Type Example Behaviour
Consumable 500 crystals Can be purchased repeatedly, consumed
Non-consumable Remove ads Purchased once, restored
Subscription Premium Membership Auto-renews, trial period available

IAP Purchase: Technical Flow

// iOS - StoreKit 2
func purchaseProduct(_ product: Product) async throws -> PurchaseResult {
    let result = try await product.purchase()
    switch result {
    case .success(let verification):
        switch verification {
        case .verified(let transaction):
            // Server-side verification
            let serverVerified = await verifyWithServer(transaction)
            if serverVerified {
                await transaction.finish()
                return .success
            } else {
                // Don't finish the transaction — don't deliver the item
                return .verificationFailed
            }
        case .unverified:
            return .verificationFailed
        }
    case .userCancelled: return .cancelled
    case .pending: return .pending
    }
}

Do not call transaction.finish() until the item is delivered. If you finish the transaction before confirming delivery, and the server fails, the item is not delivered and the transaction is completed—cannot be restored. Only after serverVerified = true.

Why Server-Side Validation Is Mandatory

Server-side verification is 100x better than client-side checking. The client can be tampered with, and receipt data can be forged. On the server, we verify the signature of the receipt with Apple/Google, enforce idempotency by transactionId, and deliver the item only after confirmation. For more details, refer to the official StoreKit 2 Documentation and Google Play Billing Library. Not a single transaction out of millions will be lost or duplicated.

Virtual Currency and Cashback

The virtual currency wallet is stored on the server. The client displays the balance received from the server at the last sync and updates it after each transaction. Cashback of up to 5% of the purchase amount is supported in the form of bonus units.

Credit logic:

POST /shop/purchase
{ "productId": "gems_pack_medium", "receiptData": "...", "userId": "..." }

→ Server verifies receipt with Apple/Google
→ Checks that the transaction has not been processed before (idempotency by transactionId)
→ Credits 550 gems to the player's balance
→ Returns { "newBalance": 1050, "transactionId": "..." }

Idempotency is mandatory: if the client sent the request twice (network failure → retry), the item is delivered once, not twice.

Purchase History

A purchase history screen is a common requirement and good practice for reducing chargebacks. The player sees all transactions with date, amount, and delivered item. This reduces "I don't remember buying that" as a dispute reason.

Technically: a purchase_history table on the server, paginated API, client list with pull-to-refresh.

Rotating Offers and Promotions

Daily Deals, Flash Sales, personalised offers—a separate type of shop item with a validUntil timestamp. The client shows a countdown timer.

For personalisation: Firebase Remote Config or a custom recommendation engine selects offers based on player behaviour (what they bought, level reached, how long since last shop visit).

Purchase Restoration: Technical Details

On iOS, a "Restore Purchases" button is mandatory for non-consumable IAP and subscriptions. Implement via Transaction.currentEntitlements in StoreKit 2. On Android, it's automatic on sign-in to Google Play, but a button in settings is also good for UX.

How to Implement a Shop: Step-by-Step Plan

  1. Design data schema for products and currencies, integrate with game economy.
  2. Integrate StoreKit 2 (iOS) and Google Play Billing 6 (Android)—register product IDs, testing in sandbox.
  3. Server-side receipt validation—endpoint for signature verification and idempotency.
  4. Virtual currency system—atomic credit/debit with logs.
  5. Purchase history screen—paginated API, pull-to-refresh.
  6. Rotating promotions mechanism—config with validUntil, client-side timers.
  7. Purchase restoration—iOS button, entitlement check.
  8. Analytics—purchase events, conversions, LTV.

What's Included in the Shop Implementation

  • Design of product and currency data schema
  • Integration of StoreKit 2 (iOS) and Google Play Billing 6 (Android)
  • Server-side receipt validation (Apple/Google)
  • Virtual currency system with idempotency
  • Purchase history screen with pagination
  • Rotating offers and personalisation mechanism
  • Purchase restoration on both platforms
  • Analytics: purchase events, conversions, LTV
Example full product configuration
{
  "productId": "premium_monthly",
  "type": "iap_subscription",
  "storeProductId": {
    "ios": "com.mygame.premium.monthly",
    "android": "premium_monthly"
  },
  "displayName": "Premium Membership",
  "description": "Double rewards, no ads, daily gems",
  "durationDays": 30,
  "trialDays": 7,
  "position": 1,
  "isVisible": true
}

Timeline: basic shop with a few products, IAP integration, and server-side validation—from 5 days. Full implementation with rotating offers, history, subscriptions, and analytics—from 2 weeks. Pricing is calculated individually.

We guarantee correct server-side validation of all purchases. Experience: 15+ game projects, servicing over 1 million daily active users and processing $2M+ in monthly IAP revenue. Get a consultation on integrating a shop into your game—contact us for a project assessment. You can also order an in-depth audit of your current monetisation with recommendations for improving metrics.

Mobile App Monetization: IAP, Subscriptions, and Ad Mediation

An app with poorly implemented purchases loses money not because users don't want to pay, but because a StoreKit transaction hangs, Receipt Validation fails with an error, or restore purchases doesn't work — and the user writes to support or leaves a 1-star review. Our experience (over 7 years in mobile development) shows that proper monetization increases LTV by 30–60% within the first three months after implementation. Get a consultation on monetizing your app — we'll analyze the current model and find growth points.

Why StoreKit 2 is the Best Choice for IAP?

StoreKit 2 (iOS 15+) is a modern API with async/await and device-side verified transactions without a server. Transaction.currentEntitlements returns all active purchases. Key change compared to StoreKit 1: JWS signature verification on device via VerificationResult<Transaction> — no need to send receipt to server for basic validation.

But server-side validation is still needed for consumable purchases and fraud prevention. App Store Server API replaces the old /verifyReceipt endpoint. Webhooks via App Store Server Notifications v2 provide real-time events: SUBSCRIBED, DID_RENEW, EXPIRED, REFUND — without polling.

A typical mistake: not handling paymentQueue(_:updatedTransactions:) in the background for unfinished transactions. User bought a consumable, app crashed before finishTransaction — purchase remains in queue, restores on next launch and requires reprocessing on server. Without server idempotency — double crediting.

How Not to Lose Revenue on Subscriptions?

The subscription model requires tracking states: trial → active → grace period → expired → refunded. RevenueCat is the de facto standard for managing subscriptions in production. It abstracts StoreKit and Google Play Billing, providing a unified API, webhooks, cohort analytics, and A/B testing of paywalls.

Alternatives to RevenueCat include custom implementations with Adapty or Qonversion. Fully custom only if data must not leave the infrastructure or there is non-standard logic. We guarantee that webhook setup and subscription lifecycle event handling is done without losses — verified on projects with over 500k DAU.

Google Play Billing Library 6+ requires handling PurchasesUpdatedListener and explicitly calling acknowledgePurchase() or consumePurchase() within 3 days — otherwise Google automatically cancels the purchase and refunds. The average cost of such an error is a significant loss per user per month (based on our project data).

Ad Mediation: Boosting CPM via Bidding

Showing ads from a single source means losing revenue. Mediation (waterfall or bidding) requests ads from multiple networks and displays the best bid. Google AdMob is the foundation for banner, interstitial, rewarded ads. Mediation via AdMob Mediation or MAX (AppLovin) is the second de facto standard. MAX uses In-App Bidding — a real-time auction without waterfall. In practice, MAX yields significantly higher CPM than classic waterfall (depending on geo and audience). For example, for rewarded video in the US, the improvement can be substantial. With 100,000 rewarded video impressions per day, switching from waterfall to In-App Bidding can generate additional daily revenue.

ironSource (Unity Ads) has a strong position in the gaming segment, especially rewarded video. Mintegral covers the Asian audience well.

Setting up mediation requires ATT (App Tracking Transparency) on iOS 14+. Without requestTrackingAuthorization, ad CPM drops by 3-5 times for non-consenting users. SKAdNetwork and Privacy Manifest (iOS 17) are mandatory requirements; without them, review fails.

Network Ad Type Feature
AdMob banner, interstitial, rewarded Wide network, easy start
MAX (AppLovin) rewarded, interstitial In-App Bidding, high fill rate
ironSource rewarded video Best for games
Mintegral rewarded, native Asia, programmatic

How We Implement Monetization: Step-by-Step Process

  1. Current model audit — analysis of funnel, paywall, price tiers, and identification of bottlenecks.
  2. Model design — choose type (subscription, consumable, non-consumable) and optimize price points.
  3. IAP integration — set up StoreKit 2 / Google Billing 6, receipt validation, webhooks.
  4. Ad mediation — connect 3-6 networks, configure waterfall or In-App Bidding, test fill rate.
  5. Analytics and cohorts — integrate RevenueCat, Amplitude, or Firebase for LTV tracking.
  6. A/B testing of paywall — use Remote Config for experiments without a release.
  7. Launch and monitoring — 2 weeks of free support after launch, bug fixes by 24-hour SLA.

How to Design a Freemium Model and Paywall?

Freemium works when the boundary between free and paid is properly drawn. Too strict a paywall at the start — users delete. Too generous a free tier — no incentive to pay.

A technically sound pattern: server-side feature flags (Remote Config in Firebase or LaunchDarkly) control access to features. This allows A/B testing of paywall without a release, changing trial conditions, and running promotions.

Implementation at the code level: EntitlementManager — a single point for checking access to features, aware of subscription status, flags, and promos. No scattered isPremium checks throughout the code. Experience shows this approach reduces paywall-related bugs by 80% (confirmed on 30+ projects).

Checklist of Typical Monetization Mistakes
  • Missing handling of unfinished transactions — revenue loss of 5-10%.
  • No server-side idempotency for consumable processing — double crediting.
  • Forgot to call acknowledgePurchase() on Android — purchase cancelled after 3 days.
  • Not handling REFUND and DID_RENEW events — incorrect subscription status.
  • Paywall without A/B testing — leaving 20-40% of monetization potential.
  • Ads from a single source (e.g., AdMob without mediation) — CPM 15-30% lower.

Scope of Monetization Work

  • Current model audit — analysis of funnel, paywall, price tiers.
  • IAP integration — StoreKit 2 / Google Billing 6, receipt validation, webhooks.
  • Ad mediation — configure MAX / AdMob, connect 3-6 networks, test fill rate.
  • Analytics setup — RevenueCat, Amplitude / Firebase, cohort analysis.
  • Documentation — description of entitlements, restoration procedure, review checklist.
  • Team training — analysis of typical mistakes, support recommendations.
  • Guarantee — 2 weeks free support after launch, bug fixes by 24-hour SLA.

Estimated Timelines

Stage Duration
Basic IAP (one store) 1–2 weeks
Subscription system + RevenueCat + paywall 3–5 weeks
Ad mediation (MAX + 3 networks) 1–2 weeks
Full cycle (IAP + ads + analytics) 4–8 weeks

Cost is calculated individually. We have been working in this field for over 8 years and have implemented monetization in over 40 projects — many of which passed App Store Review without a single rejection. Contact us for an audit or order a consultation — we'll tell you what growth points exist in your app.