Skip to content

feat(mobile): local notification scheduler for hunt expiry (#219)#261

Open
euniceamoni wants to merge 2 commits into
Samuel1-ona:mainfrom
euniceamoni:feat/local-notification-scheduler
Open

feat(mobile): local notification scheduler for hunt expiry (#219)#261
euniceamoni wants to merge 2 commits into
Samuel1-ona:mainfrom
euniceamoni:feat/local-notification-scheduler

Conversation

@euniceamoni
Copy link
Copy Markdown

@euniceamoni euniceamoni commented May 26, 2026

Summary

Implements issue #219 — schedules a local OS notification 1 hour before a joined hunt expires, fully offline using expo-notifications.

Changes

  • mobile/package.json — added expo-notifications ~0.30.0
  • mobile/utils/huntNotifications.ts — new utility with scheduleHuntExpiryNotification and cancelHuntExpiryNotification
  • mobile/app/_layout.tsx — registers notification handler and requests OS permission on launch
  • mobile/store/huntStore.ts — adds joinHunt(huntId) which schedules the expiry reminder after a player joins

Usage

import { joinHunt } from '@store/huntStore';

// after successful on-chain registration:
await joinHunt(hunt.id);

Notes

  • Notification fires completely offline — no network call involved
  • Delivered even when the app is backgrounded or closed
  • Duplicate reminders are prevented (existing notification cancelled before rescheduling)
  • No-ops silently if endTime is missing or already within 1 hour closes [Mobile] Local Notification Scheduler #219

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.

[Mobile] Local Notification Scheduler

1 participant