Skip to content

General: Add yearly subscription option and improve FOSS sponsor experience#429

Merged
d4rken merged 1 commit intomainfrom
feat/subscription-billing
Mar 4, 2026
Merged

General: Add yearly subscription option and improve FOSS sponsor experience#429
d4rken merged 1 commit intomainfrom
feat/subscription-billing

Conversation

@d4rken
Copy link
Copy Markdown
Member

@d4rken d4rken commented Mar 4, 2026

What changed

  • Added a yearly subscription option (with optional free trial) as an alternative to the existing one-time purchase on Google Play
  • The upgrade screen now shows both options with pricing so users can choose their preferred billing method
  • FOSS version now nudges users to actually visit the sponsor page before unlocking features, with a friendly reminder if they return too quickly
  • Added "No ads. No tracking. No Google Play lock-in." subtitle to the FOSS sponsor screen

Technical Context

  • Rewrote the SKU type system from a flat data class to an interface hierarchy (Sku.Iap, Sku.Subscription) to cleanly support both billing models with type-safe offer matching
  • Subscription offers (base plan, trial) are matched by plan ID against Google Play's subscriptionOfferDetails, following the same pattern used in sdmaid-se/octi
  • FOSS sponsor gate uses SystemClock.elapsedRealtime() + SavedStateHandle to survive process death and prevent clock manipulation
  • Converted gplay UpgradeViewModel.state to StateFlow via stateIn to avoid re-querying billing on config changes
  • Removed Activity references from BillingEvent channel to prevent stale activity leaks across config changes

Rewrite SKU type system from data class to interface hierarchy supporting both IAP and subscriptions. Add subscription query, offer matching, and billing flow launch for yearly plans with optional free trial.

FOSS: Add sponsor-gate with 10-second timer and snackbar nudge.
@d4rken d4rken added the enhancement Add a new feature of improve an existing feature label Mar 4, 2026
@d4rken d4rken merged commit e35bce4 into main Mar 4, 2026
9 checks passed
@d4rken d4rken deleted the feat/subscription-billing branch March 4, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Add a new feature of improve an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant