chore: update icon
This commit is contained in:
@@ -95,7 +95,6 @@ export function NotificationProvider({ children }: { children: ReactNode }) {
|
||||
[],
|
||||
);
|
||||
|
||||
// Enregistrement push notifications
|
||||
useEffect(() => {
|
||||
let isMounted = true;
|
||||
|
||||
@@ -103,18 +102,14 @@ export function NotificationProvider({ children }: { children: ReactNode }) {
|
||||
const token = await getToken();
|
||||
if (!token) return;
|
||||
|
||||
// Configurer le channel Android
|
||||
await setupNotificationChannel();
|
||||
|
||||
// Obtenir le push token
|
||||
const expoPushToken = await registerForPushNotificationsAsync();
|
||||
if (expoPushToken && isMounted) {
|
||||
setPushToken(expoPushToken);
|
||||
// Envoyer au backend
|
||||
await sendPushTokenToBackend(expoPushToken);
|
||||
}
|
||||
|
||||
// Vérifier si l'app a été ouverte par une notification
|
||||
const lastResponse = await getLastNotificationResponse();
|
||||
if (lastResponse && isMounted) {
|
||||
const data = lastResponse.notification.request.content.data;
|
||||
@@ -131,9 +126,7 @@ export function NotificationProvider({ children }: { children: ReactNode }) {
|
||||
};
|
||||
}, []);
|
||||
|
||||
// Listeners pour les notifications push
|
||||
useEffect(() => {
|
||||
// Notification reçue en foreground
|
||||
const receivedSub = addNotificationReceivedListener((notification) => {
|
||||
const { title, body } = notification.request.content;
|
||||
const data = notification.request.content.data;
|
||||
|
||||
Reference in New Issue
Block a user