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.
Interview question
What common oversight can prevent local notifications from appearing on Android devices, even if scheduled correctly?
- a.Failure to define appropriate Notification Channels for the alerts.Correct
- b.A lack of an active internet connection on the user's device.
- c.The app being closed or in the background at the scheduled time.
- d.The absence of a backend server to push the notification.
Why? this is the answer
The card explicitly states that "forgetting to create Android Notification Channels will cause your alerts to fail silently." Local notifications are designed to function offline and when the app is closed, and they do not require a backend server.
Just read this? Test yourself on what you have been reading.
Read the original → notifee.app
- #react-native
- #mobile
- #notifications
- #android
- #ios
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on react-native — each one lists the topics its interview covers.
See open roles