WhoBuilt

Local Notifications in React Native

Nov 5, 2021· 35 min· 1.4K views·Watch on YouTube

Speaker

Helena Ford, CTO at UK mobile development agency Tiger and an active Notifee maintainer at Invertase, presents a React Native EU 2021 demo on local notifications for Callstack.

Local notifications and Notifee

Ford explains that local notifications are configured on the device, so they can work without a third-party push service. She introduces Notifee as a library for building notifications and handling scheduling, background tasks, and device differences.

Build rich notifications

Ford demonstrates displaying a basic notification with Notifee and explains Android’s channel requirement. She recommends high channel importance for banner alerts and notes that channel settings cannot be changed after creation. The demo adds icons and images, then shows video attachments on iOS, which requires requesting notification permissions.

Add notification actions

Ford shows how Android actions can let users open an episode or bookmark it from the notification. Background and foreground event handlers respond to those presses, and notification data can carry a show ID as a string. On iOS, actions are defined in categories that are set up before the notification is displayed.

Schedule reminders

Ford uses a TV show reminder as an example of a scheduled notification, such as an alert before an episode airs. Notifee supports timestamp triggers for a date and time, and interval triggers for repeated or countdown alerts. The demo also handles dismissing a reminder by cancelling its notification.

Resources and licensing

Ford says local scheduling can support useful reminders without a database and notes that the demo code is on GitHub. Notifee is free for development; production use requires an Android license. Invertase offered 100 free licenses with the code RNEU.

Takeaways

  • Use local notifications for device-based reminders that do not depend on a push service.
  • Set Android channel importance to high when an alert should appear as a banner.
  • Create Android channels with user-friendly names because their settings cannot be edited later.
  • Use foreground and background handlers to respond to notification actions in the right app state.
  • Choose timestamp triggers for scheduled dates and interval triggers for repeating or countdown alerts.

Mentioned in this talk

Search inside this talk

What was claimed 7

Related talks