Loyalty Program in Mobile App

NOVASOLUTIONS.TECHNOLOGY 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 1 servicesAll 1735 services
Loyalty Program in Mobile App
Medium
~5 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Implementing a Loyalty Program in Mobile Apps

A loyalty program in a mobile app is not just "accumulate points". Behind a simple interface lies non-trivial server logic: transactional crediting, preventing fraud, point expiry, and state synchronization across sessions. The server-side cannot be underestimated here.

Data model and transactionality

Point balance cannot be stored as a single number in the user.points field. You need a transaction log:

loyalty_transactions:
  id UUID PK
  user_id UUID FK
  type ENUM('earn', 'redeem', 'expire', 'refund', 'bonus')
  amount INTEGER  -- positive for earn, negative for redeem
  reference_id UUID  -- purchase_id, action_id
  reference_type VARCHAR
  expires_at TIMESTAMP  -- for earn transactions
  created_at TIMESTAMP

-- Balance = sum of amount from non-expired transactions
-- SELECT COALESCE(SUM(amount), 0) FROM loyalty_transactions
-- WHERE user_id = ? AND (expires_at IS NULL OR expires_at > NOW())

This enables: reversing credits on purchase refund, implementing expiry with transaction precision, auditing any balance changes.

All balance change operations — through database transaction with SERIALIZABLE isolation level for counters, or through optimistic locking. Without this, parallel requests (multiple tabs, repeated tap) can cause balance to go negative.

Credit mechanisms

Basic variants: per purchase (N points per unit), per action (registration, review, friend invitation), bonus periods (x2 on weekends). Each type — separate rule in loyalty_rules table with conditions and coefficients. This allows changing mechanics without deployment.

Fraud prevention: limit credits per action per time unit (rate limiting by user_id + action_type), verify actions (e.g., review counts only after moderation), limit referral credits.

Client implementation

On the mobile client — three key screens: balance with transaction history, rewards catalog, redemption screen. Balance synchronizes on every app open and through WebSocket/SSE during active operations.

// Swift — subscribe to balance updates via WebSocket
class LoyaltyViewModel: ObservableObject {
    @Published var balance: Int = 0
    @Published var transactions: [LoyaltyTransaction] = []

    func subscribeToUpdates() {
        webSocketService.subscribe(channel: "loyalty.\(userID)") { [weak self] event in
            DispatchQueue.main.async {
                self?.balance = event.newBalance
                self?.transactions.insert(event.transaction, at: 0)
            }
        }
    }
}

Loyalty program tiers

Tiered system (Bronze → Silver → Gold) requires recalculating tier on each balance change. Better to store total_earned (accumulated per period without deductions) separately from current balance — it's this value that determines the tier.

Tier reset dates (usually annually) — separate background task or cron. Need to notify users 30 days before tier downgrade.

Integration with IAP

On purchase through In-App Purchase: points are credited on the server after transaction verification, before finishTransaction on client you don't need to wait — points can be credited asynchronously. On refund through Apple/Google — handle webhook and create a refund transaction in the log.

Implementation time — approximately 5 days: schema design, server crediting and redemption logic, client screens, notifications.