handling pushnotifications when app is closed

Take a look here.

  useEffect(() => {
    Notifications.addListener(handleNotification);
  }, []);

  const handleNotification = (notification) => {
    Vibration.vibrate();
    console.log(notification);
  };