feat: bg location lost notify

This commit is contained in:
devthejo 2025-04-24 17:30:47 +02:00
parent 9368ec440a
commit f08bd08ece
2 changed files with 12 additions and 0 deletions

View file

@ -86,6 +86,14 @@ export const generateSuggestKeepOpenContent = (data) => {
}; };
}; };
export const generateBackgroundGeolocationLostContent = (data) => {
return {
title: `Localisation en arrière-plan désactivée`,
body: `Votre localisation en arrière-plan a été désactivée. Veuillez vérifier les paramètres de l'application.`,
bigText: `Votre localisation en arrière-plan a été désactivée. Pour continuer à utiliser pleinement l'application, veuillez vérifier les paramètres de votre appareil.`,
};
};
export const getNotificationContent = (enumType, data) => { export const getNotificationContent = (enumType, data) => {
const type = kebabCase(enumType); const type = kebabCase(enumType);
@ -106,6 +114,8 @@ export const getNotificationContent = (enumType, data) => {
return generateSuggestCloseContent(data); return generateSuggestCloseContent(data);
case "suggest-keep-open": case "suggest-keep-open":
return generateSuggestKeepOpenContent(data); return generateSuggestKeepOpenContent(data);
case "background-geolocation-lost":
return generateBackgroundGeolocationLostContent(data);
default: default:
return { title: type, body: JSON.stringify(data) }; return { title: type, body: JSON.stringify(data) };
} }

View file

@ -1,5 +1,6 @@
import { VirtualNotificationTypes } from "./virtualNotifications"; import { VirtualNotificationTypes } from "./virtualNotifications";
import { getNotificationContent } from "./content"; import { getNotificationContent } from "./content";
import openSettings from "~/lib/native/openSettings";
export const getNotificationColor = (notification, theme) => { export const getNotificationColor = (notification, theme) => {
const { colors } = theme; const { colors } = theme;
@ -82,6 +83,7 @@ export const createNotificationHandlers = (handlers) => {
suggest_keep_open: async (data) => await openAlert({ data }), suggest_keep_open: async (data) => await openAlert({ data }),
relative_invitation: async (data) => await openRelatives({ data }), relative_invitation: async (data) => await openRelatives({ data }),
relative_allow_ask: async (data) => await openRelatives({ data }), relative_allow_ask: async (data) => await openRelatives({ data }),
background_geolocation_lost: async (data) => openSettings(),
}; };
return { return {