Developing Mobile App for Loyalty Program
Loyalty program without mobile app loses half its value — customer doesn't see balance at right moment, promotion ends before they open email. Core technical task isn't "beautiful design" but real-time balance synchronization between POS, server and client without drift.
Where Typical Implementations Break
Balance drift. Cashier credits points — client shows old balance for 10 minutes. Reason: cache without invalidation — balance requested at app launch, cached in NSUserDefaults or SharedPreferences without TTL, doesn't update after push event. Solved via APNS/FCM Data Message (silent push) with loyalty_balance_updated payload — app silently does background refresh via URLSession background task or WorkManager.
Digital card offline. Barcode or QR of member card must work without internet — POS scanner doesn't depend on user's connectivity. Generation on client from member_id + hmac_secret via HMAC-SHA256 with rotation every N seconds (like TOTP) solves without constant API calls. Barcode rendered via ZXingObjC / ZXing-Android-Embedded or native means — CIFilter(name: "CICode128BarcodeGenerator") on iOS.
Tiers and progress bar. Tier transition (Silver → Gold) should display animated when credited, not on next open. If backend sends tier_upgraded event in push — app should open screen with Lottie animation, not just update number. Requires correct UNUserNotificationCenter foreground handling + deep link in SceneDelegate/onOpenURL.
Separate pain — personalized offers. If offers load in one bulk request hourly, user sees stale offer. Better: OffersFeedRepository with paging via Jetpack Paging 3 or custom cursor, push invalidation, local cache in Room/Core Data with expires_at.
Architecture and Stack
For most loyalty projects choose Flutter (single codebase iOS + Android) or React Native — depends if you already have RN team. Native Swift/Kotlin justified if app integrates with Wallet (Apple Wallet Passes + Google Wallet API) — native SDK more convenient there.
Key integrations:
-
Apple Wallet / Google Wallet —
PKPassLibraryon iOS to add/update card directly from app. Pass updates via push withwebServiceURL— server sends new.pkpasswith current balance automatically. - Firebase Crashlytics + Analytics — track conversion to activation, redemption rate by offers.
- Branch.io or Firebase Dynamic Links — deep link for referral ("Invite friend").
- RevenueCat — if loyalty app has premium subscription (expanded privileges).
Client data structure: MemberProfile (id, tier, balance, card_number), OfferList (paged, cacheable), TransactionHistory (infinite scroll, Room/Core Data). Separate SyncManager listens FCM Data Messages and invalidates right cache precisely, not whole profile.
Work Process
Audit existing loyalty program and API → design sync data scheme → UI/UX design (balance, history, offer catalog, card) → development → POS integration → QA (especially offline + push scenarios) → release → support.
If backend not ready — parallel design API contracts (OpenAPI 3.0) and develop mocks via WireMock / MSW.
Timeline Guidelines
MVP with balance, transaction history, QR card and basic offers — 4–8 weeks. Full app with Apple/Google Wallet, personalized offers, push campaigns and referral mechanics — 2–3 months. Non-standard POS integration adds 2–3 weeks on adapter development.







