CustomerInfoManager

class CustomerInfoManager(storage: Storage, updateCustomerInfo: (CustomerInfo) -> Unit, ioScope: IOScope, hasExternalPurchaseController: () -> Boolean, getSubscriptionStatus: () -> SubscriptionStatus)(source)

Manages merging of device and web CustomerInfo sources.

This class is responsible for:

  • Reading device CustomerInfo (built from Google Play receipts)

  • Reading web CustomerInfo (fetched from Superwall backend)

  • Merging both sources using priority-based rules

  • Updating the public CustomerInfo flow that the SDK exposes

  • Persisting the merged result to storage

When an external purchase controller is present (e.g., RevenueCat, Qonversion):

  • The subscription status is the source of truth for active entitlements

  • Device receipts are only used for inactive entitlements (history)

  • This preserves entitlements set by external controllers that device receipts don't know about

The merge happens whenever:

  • Device receipts are refreshed (via ReceiptManager)

  • Web entitlements are fetched (via WebPaywallRedeemer)

  • SDK initialization completes

Constructors

Link copied to clipboard
constructor(storage: Storage, updateCustomerInfo: (CustomerInfo) -> Unit, ioScope: IOScope, hasExternalPurchaseController: () -> Boolean, getSubscriptionStatus: () -> SubscriptionStatus)

Functions

Link copied to clipboard

Merges device and web CustomerInfo and updates the public CustomerInfo flow.