From f08bd08ece0aafe43f8bb411953c1e1b504204be Mon Sep 17 00:00:00 2001 From: devthejo Date: Thu, 24 Apr 2025 17:30:47 +0200 Subject: [PATCH] feat: bg location lost notify --- src/notifications/content.js | 10 ++++++++++ src/notifications/notificationTypes.js | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/notifications/content.js b/src/notifications/content.js index 7bdcb86..448e4d1 100644 --- a/src/notifications/content.js +++ b/src/notifications/content.js @@ -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) => { const type = kebabCase(enumType); @@ -106,6 +114,8 @@ export const getNotificationContent = (enumType, data) => { return generateSuggestCloseContent(data); case "suggest-keep-open": return generateSuggestKeepOpenContent(data); + case "background-geolocation-lost": + return generateBackgroundGeolocationLostContent(data); default: return { title: type, body: JSON.stringify(data) }; } diff --git a/src/notifications/notificationTypes.js b/src/notifications/notificationTypes.js index cdd5b95..65c3298 100644 --- a/src/notifications/notificationTypes.js +++ b/src/notifications/notificationTypes.js @@ -1,5 +1,6 @@ import { VirtualNotificationTypes } from "./virtualNotifications"; import { getNotificationContent } from "./content"; +import openSettings from "~/lib/native/openSettings"; export const getNotificationColor = (notification, theme) => { const { colors } = theme; @@ -82,6 +83,7 @@ export const createNotificationHandlers = (handlers) => { suggest_keep_open: async (data) => await openAlert({ data }), relative_invitation: async (data) => await openRelatives({ data }), relative_allow_ask: async (data) => await openRelatives({ data }), + background_geolocation_lost: async (data) => openSettings(), }; return {