The Cross-Platform Challenge
Most mobile apps ship on both iOS and Android, but each platform handles in-app purchases differently. Apple uses StoreKit and App Store Server Notifications. Google uses the Billing Library and Real-Time Developer Notifications. Validating purchases and maintaining affiliate attribution across both platforms requires a unified approach.
Why Cross-Platform Validation Matters
Without unified purchase validation, you face several problems:
- Affiliate conversions on one platform may be missed or miscounted
- Commission calculations may differ between platforms
- Your reporting shows fragmented data that is difficult to analyse
- Users who switch devices between clicking an affiliate link and making a purchase may lose their attribution
A unified validation layer solves these problems by providing a single source of truth for all purchases regardless of platform.
The Subscription Management Approach
The simplest way to handle cross-platform validation is through a subscription management service like RevenueCat or Adapty. These services:
- Provide a single SDK that works on both iOS and Android
- Validate receipts with both Apple and Google servers
- Normalise purchase events into a unified format
- Send webhook events for all subscription lifecycle changes
Insert Affiliate receives these normalised webhook events and matches them to affiliate attributions regardless of which platform processed the actual payment.
This architecture means you write the purchase handling code once (through the subscription management SDK) and affiliate tracking works automatically on both platforms.
Direct Store Integration Approach
If you prefer not to use a third-party subscription management service, Insert Affiliate also integrates directly with both App Store Server Notifications (V2) and Google Play Real-Time Developer Notifications.
For iOS: Configure App Store Server Notifications to send events to Insert Affiliate's endpoint. The notifications include transaction data in signed JWTs that Insert Affiliate verifies and processes.
For Android: Configure Google Cloud Pub/Sub to forward Real-Time Developer Notifications to Insert Affiliate. The notifications contain subscription and purchase state changes.
With direct integration, your app handles purchase processing natively on each platform while Insert Affiliate handles the affiliate attribution layer.
Maintaining Attribution Across Platforms
The critical challenge is connecting the affiliate link click to the eventual purchase when these events happen on different platforms:
Scenario 1 β Same device: User clicks an affiliate link on their iPhone, installs from the App Store, and purchases. This is the standard flow and attribution works through Insert Affiliate's deep linking and SDK.
Scenario 2 β Web to app: User clicks an affiliate link on a desktop browser, later installs on their phone. Insert Affiliate's deferred deep linking handles this by storing the attribution server-side and matching it when the user creates an account.
Scenario 3 β Cross-device: User clicks an affiliate link on one device and purchases on another. Account-level attribution handles this β when the user signs in on the purchasing device, the stored attribution connects the purchase to the original affiliate.
Handling Purchase Types
Different purchase types require different validation approaches:
Auto-renewable subscriptions: Both platforms send server notifications for initial purchases, renewals, cancellations, and billing retries. These are the most straightforward to track because the platform notifies you of every state change.
Consumable purchases: No server notifications are sent for consumables on either platform. Your app must validate the receipt at purchase time and report the event to Insert Affiliate through the SDK.
Non-consumable purchases: Similar to consumables β validate at purchase time and report through the SDK.
Testing Cross-Platform
Test the complete flow on both platforms independently:
- Click a test affiliate link on each platform
- Complete sandbox purchases on each platform
- Verify attribution appears correctly in Insert Affiliate's dashboard
- Confirm webhook events from both platforms are received and processed
- Validate commission calculations are consistent across platforms
Sandbox environments exist for both Apple (App Store sandbox) and Google (test tracks in Google Play Console). Use them extensively before going live.
Best Practices
Use a subscription management service unless you have a specific reason not to. The engineering cost of maintaining direct integrations with both Apple and Google APIs is significant and ongoing as both platforms update their systems.
Whichever approach you choose, ensure all purchase events flow through a single attribution system (Insert Affiliate) so your reporting is unified and accurate across platforms.
