The Notification service provides local push notification functionality for payment confirmations. It handles permission requests and sends immediate notifications using expo-notifications.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Diego31-10/TableOrderApp/llms.txt
Use this file to discover all available pages before exploring further.
Configuration
The service configures notification behavior for foreground display:Functions
requestNotificationPermissions
Requests notification permissions from the user. Should be called during app startup or before the first notification.true if permissions were granted, false otherwiseExample
Behavior
- Checks existing permissions using
getPermissionsAsync() - Returns
trueimmediately if already granted - Otherwise requests permissions using
requestPermissionsAsync() - Returns the result of the permission request
sendPaymentNotification
Fires an immediate local notification confirming a successful payment.Payment amount to display in the notification body
Table name to display in the notification body (e.g., “Mesa 5”)
Returns void after scheduling the notification. If permissions are denied, the function returns early without sending.
Example
Complete checkout flow
Notification content
Title
Body template
Example notification
Sound
Notifications play the default system sound (sound: true).
Trigger
Notifications fire immediately usingtrigger: null:
Permission handling
Auto-request
sendPaymentNotification automatically requests permissions before sending:
Manual request
You can request permissions proactively during onboarding:Platform considerations
iOS
- First call to
requestPermissionsAsync()shows the system permission dialog - Subsequent calls return the cached permission status
- Users can revoke permissions in Settings → [App Name] → Notifications
Android
- Android 13+ requires explicit permission request (handled by expo-notifications)
- Earlier versions grant notification permissions by default
- Users can revoke in Settings → Apps → [App Name] → Notifications
Best practices
-
Request permissions early: Call
requestNotificationPermissions()during app initialization or onboarding - Handle denial gracefully: The app should still function if notifications are denied
- Don’t spam: Only send notifications for important events (payment success, order ready, etc.)
- Test on device: Notifications don’t work reliably in simulators
Local notifications (like these) work without any backend setup. They’re scheduled directly on the device and don’t require push notification certificates or FCM/APNs configuration.
Integration with other services
Notifications complement other feedback mechanisms:- Sound service: Plays audio beep for immediate feedback
- Haptics: Provides tactile confirmation
- Notifications: Persistent confirmation that survives app backgrounding