-
Notifications
You must be signed in to change notification settings - Fork 0
IAP
PrayCalc uses native in-app purchase APIs on iOS and Android. The implementation uses StoreKit 2 on iOS and Google Play Billing on Android, both via native Flutter plugins.
Plugin: flutter/ios/PrayCalcApp/IAPPlugin.swift
StoreKit 2 is used for all purchase flows. It provides async/await APIs, automatic transaction verification, and built-in receipt validation.
Product IDs are defined in App Store Connect and referenced via StoreKit/Products.storekit in the Xcode project.
- App calls
IAPPlugin.loadProducts()— returns availableProductobjects from StoreKit - User taps purchase — app calls
IAPPlugin.purchase(productId) - StoreKit presents the payment sheet
- On success,
Transaction.currentEntitlement(for:)is polled to verify entitlement - App unlocks the feature and calls
Transaction.finish()to clear the queue
Call IAPPlugin.restorePurchases() — this calls AppStore.sync() which re-fetches the signed transaction history from Apple. Works across device reinstalls.
Users manage subscriptions from the iOS Settings app or via the App Store subscriptions page. The app links there directly from the account screen.
Use a Sandbox test account (App Store Connect > Users and Access > Sandbox) to test purchases without real payment. Sandbox purchases expire rapidly (e.g. 1-month subscription = 5 minutes in sandbox).
Plugin: flutter/android/app/src/main/kotlin/com/praycalc/app/IAPPlugin.kt
Uses Google Play Billing Library (latest stable). All billing operations run on the main thread via the BillingClient.
- App initialises
BillingClientand callsqueryProductDetailsAsync()to load SKUs - User taps purchase — app calls
launchBillingFlow()with aBillingFlowParams - Google Play presents the payment sheet
- On purchase result, app calls
queryPurchasesAsync()and acknowledges the purchase server-side - Feature is unlocked and
BillingClient.acknowledgePurchase()is called within 3 days (Google requirement)
Call BillingClient.queryPurchasesAsync(ProductType.SUBS) — returns all active subscriptions tied to the Google account.
Use the Google Play License Testing accounts (configured in Google Play Console > Setup > License Testing). The test account bypasses real payment and allows testing all purchase states including PURCHASED, CANCELED, PENDING, and ITEM_ALREADY_OWNED.
The following features require an active Ummat+ subscription:
- Smart home prayer automations
- TV Command Center (manage connected TVs)
- Priority adhan notifications
- Premium adhan voices
- Ad-free experience
See Smart-Home for the full smart home feature list.
- Features — full feature list with status
- Account-Deletion — deleting an account cancels active subscriptions
- Apple documentation: StoreKit 2
- Google documentation: Play Billing Library
PrayCalc by Ummat Dev | MIT License