7. Detect notification #

Created Sat Dec 30, 2023 at 1:56 PM

Setup #

The setup to detect is simple:

  1. There’s some UI config
  2. Hook into the Notification subsystem via Expo’s Notificationspackage.
  3. We store new notification objects from this listening to the store/state.
  4. Upon app close (i.e. root level component cleanup), un-hook the listener.

Already seen in a previous page - we listen for notifications via an event listener and Notifications expo API. This listener is usually added at the root level component.

Service response #

Received Notification objects has many keys So, it’s a small object - we get response body in .data.

We’ll see how local notifications work soon.