The Complete Guide to iOS vs Android Subscription Architecture
Building in-app purchases is one of those tasks that sounds simple in the API documentation but becomes a labyrinth in production. Once you expand from a single app store to cross-platform support across iOS and Android, the challenges multiply exponentially.
The Core Architectural Differences
At their core, Apple's StoreKit 2 and Google Play Billing Library approach subscription states differently. StoreKit 2 is highly cryptographic, focusing on local JWS (JSON Web Signature) verification of transactions. Google Play Billing relies heavily on server-side queries using the Google Play Developer API to determine subscription states.
1. Receipt Validation vs. Transaction Status
On iOS, StoreKit 2 provides a continuous flow of JWS transactions. You can verify these transactions on-device using public keys provided by Apple, or send them to your backend for decryption and synchronization. On Android, Google returns a purchase token. Your app must send this token to your backend, which then queries Google's APIs to determine if the subscription is active, trialing, or expired.
2. Subscription Lifecycle and Webhooks
One of the most complex pieces of subscription architecture is webhook synchronization. Users can change their subscriptions outside of your application: they can cancel via their iCloud settings, request a refund from Google, or experience billing issues. To keep your backend database in sync, you must handle server-to-server notifications:
- App Store Server Notifications V2: Apple delivers rich JWS notification payloads describing events like
SUBSCRIBED,DID_CHANGE_RENEWAL_STATUS,REFUND, andGRACE_PERIOD_EXPIRED. - Real-Time Developer Notifications (RTDN): Google Play publishes events to a Google Cloud Pub/Sub topic, which you must configure to forward to your server endpoints.
Common Pitfalls in Cross-Platform Sync
When trying to merge these two architectures into a unified user database, developers frequently stumble over several major hurdles:
"The biggest trap is assuming webhook delivery is immediate or ordered. Network latency and retries can easily cause a cancellation webhook to arrive before a subscription renewal webhook."
The Grace Period Trap
When a user's card fails, both stores offer grace periods during which the user retains access while the store attempts retry-billing. Apple and Google handle this status under completely different names and fields. If your local DB logic doesn't carefully map these states, you risk either cutting off valid paying users or granting free lifetime access to failed accounts.
How BillDog Simplifies This
Rather than managing two separate SDK cycles, writing custom validation logic, and handling edge cases for dozens of webhook payloads, BillDog abstracts this entire flow into a single unified schema. Your frontend simply requests the user's active entitlements, and our SDK guarantees a cryptographically verified, server-synced response across both platforms.
Get the BillDog newsletter
Practical guides on subscription pricing, paywalls and app growth, about twice a month. No spam.
