Local Notifications: Your App's On-Device Messenger
Local notifications are messages your app sends to itself on the user's device, no server needed. Use them for timers, reminders, or download progress. The footgun: forgetting to create Android Notification Channels will cause your alerts to fail silently.
WHY IT EXISTS To allow an app to re-engage a user or provide timely information without relying on a network connection or a backend server. It's for app-driven, not server-driven, communication, enabling features like alarms, reminders, and progress updates that function entirely offline.
THE MENTAL MODEL Think of local notifications as a self-messaging system. Your app leaves a note for the operating system, saying "at this time, or when this event happens, show this message to the user on my behalf." This happens entirely on the device, independent of any server.
HOW IT WORKS Your React Native code uses a library to call native OS APIs. You define the notification's content (title, body, images), style (e.g., Big Picture, Inbox), and behavior (quick actions, sounds). You can display it immediately or create a trigger to schedule it for a future time or on a repeating interval. The OS then takes over and displays the notification at the right moment, even if the app is in the background or closed. You can also hook into events like dismissal or action presses to run JavaScript code in the background.
WHEN TO USE IT Use local notifications for tasks initiated and completed on the device. Three common places are: first, time-based alerts like a pomodoro timer or calendar event; second, progress indicators for long-running foreground services like music playback or navigation; third, reminders based on in-app events, like an e-commerce app reminding you about an abandoned cart.
WHEN NOT TO USE IT Do not use local notifications when the alert depends on external, real-time data from other users or a central system. For breaking news, new chat messages from friends, or a flash sale starting, you need a remote push notification sent from a server.
ONE CANONICAL EXAMPLE A user sets a reminder in a medication app for 8 AM daily. The app creates a local notification with a repeating trigger. Every morning at 8 AM, the OS displays the "Time to take your medication" alert, with "Snooze" and "Taken" action buttons, even if the phone has no internet connection. The app only needs to schedule it once.
Read the original → notifee.app
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.