Skip to content

feat: like-limit countdown as Live Activity (iOS) and Live Update (Android) - #79

Closed
GSTJ wants to merge 3 commits into
mainfrom
GSTJ/live-status
Closed

feat: like-limit countdown as Live Activity (iOS) and Live Update (Android)#79
GSTJ wants to merge 3 commits into
mainfrom
GSTJ/live-status

Conversation

@GSTJ

@GSTJ GSTJ commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

When a free user runs out of daily likes, the "likes recharging" countdown now lives on the lock screen and in the Dynamic Island on iOS, and as a promoted progress notification on Android 16+.

Details

  • Hook: the swipe flow already knows when the 10-likes/24h limit hits and when it resets; the same spot now starts a native live status, ended on the next successful swipe or when the timer expires.
  • iOS: hand-written Swift, no wrapper lib (the community one is archived). A local Expo module wraps ActivityKit (iOS 16.2+ gates, no-op below) and a widget-extension target (via @bacons/apple-targets) renders the branded SwiftUI UI: lock-screen card with paw badge and system-driven countdown, full Dynamic Island (compact, minimal and expanded states with progress bar), stale-state "likes are back" label, deep link into the swipe tab.
  • Bonus from watchOS 11+: this activity mirrors automatically into the Apple Watch Smart Stack, zero watch code.
  • Android: promoted Live Update notification on API 36.1+, regular notification fallback below, same countdown and deep link.
  • Release heads-up (not merge-blocking): EAS device/store builds will need ios.appleTeamId in the app config and credentials for the new extension bundle id the first time.
  • Version bumped to 1.5.0.

Testing steps

  1. As a free (non-premium) account, swipe until the daily like limit hits and the countdown modal appears.
  2. iPhone (iOS 16.2+): lock the phone, a card should be on the lock screen showing "likes recharging" with a live countdown. On models with Dynamic Island, the paw + timer should sit in the island; long-press it to see the expanded view with the progress bar.
  3. Tap the activity: the app should open on the swipe screen.
  4. Swipe successfully after the timer ends (or on a premium account): the activity should disappear.
  5. If you have an Apple Watch on watchOS 11+, glance at the Smart Stack: the same countdown should appear there on its own.
  6. Android 16+: the countdown shows as a prominent progress notification; older Android gets a normal notification.

GSTJ added 3 commits July 8, 2026 16:06
… Live Updates

When a free user hits the daily like limit, we now start a glanceable
countdown to the reset outside the app:

- iOS 16.2+: real ActivityKit Live Activity via a local Expo module
  (modules/pegada-live-status) plus a hand-rolled widget-extension target
  (targets/like-limit-activity, wired by @bacons/apple-targets). Custom
  SwiftUI for lock screen + Dynamic Island (compact/minimal/expanded),
  system-driven timer and progress bar, stale-state label, deep link back
  to the swipe tab. Ends on next successful swipe or when the timer
  expires and the app comes back to foreground.
- Android: same JS API, Kotlin side posts a chronometer countdown
  notification; on Android 16.1+ (API 36.1) it's promoted via
  setRequestPromotedOngoing + ProgressStyle so it surfaces as a Live
  Update (status bar chip / AOD card), gated on SDK_INT_FULL and
  canPostPromotedNotifications. Auto-dismisses at reset via
  setTimeoutAfter. Module compiles against the 36.1 minor SDK.
- Strings localized in en/pt-BR and passed into native from JS, so the
  native side stays copy-free.
- Below iOS 16.2 / when activities are disabled: no-op.

Follow-up (out of scope for v1): push-driven updates via
Activity.pushTokenUpdates, and ending the iOS activity server-side.
…sion target

iOS allows one widget extension per app, so targets/like-limit-activity
becomes the shared targets/pegada-widgets target (deploymentTarget 16.2,
byte-identical config across feature branches). The Live Activity registers
itself in PegadaWidgetsBundle.swift.
@GSTJ

GSTJ commented Jul 25, 2026

Copy link
Copy Markdown
Owner Author

closing this one out, hasn't moved in a couple weeks, ping me if it's still alive

@GSTJ GSTJ closed this Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant