chore: fix push notif

This commit is contained in:
2026-03-02 18:29:29 +01:00
parent 06ddf705a0
commit 0085a39537
5 changed files with 45 additions and 4 deletions
+1
View File
@@ -17,6 +17,7 @@
"bundleIdentifier": "com.uberstup.clientpanel"
},
"android": {
"googleServicesFile": "./google-services.json",
"adaptiveIcon": {
"foregroundImage": "./assets/icon.png",
"backgroundColor": "#000000"
+29
View File
@@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "358179533147",
"project_id": "milieu-nantais",
"storage_bucket": "milieu-nantais.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:358179533147:android:20728599f7c862e2362a7e",
"android_client_info": {
"package_name": "com.uberstup.clientpanel"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDrmjxyOKq5r2VXwfrfiNx-aQrGwNkiyCs"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
@@ -0,0 +1,13 @@
{
"type": "service_account",
"project_id": "milieu-nantais",
"private_key_id": "51a81342e30ff18ab089745e431631c6e060687f",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDPOZDgOSeDfSpu\n/pCQube8ltjsBCFlIjxuUDpN5d+3GPpH7GZlUnNzScajw9WwLrprvzcAjnaN7Nx5\nyrv/SijLPzVIL9ntniDb/reCh+XycMz36zmuxLzFZcyQmYaYOl3XcVjm5u8GC+l6\nIFeHK55WymhH3/dygssGeLGLJRrTbfkj6YL+CqHM+roomdBlAQNh8Ds+XauyeCZ6\n/fDFlKoyloLKtbvjdxRN0dTP44r93afFFDJjGsLxDyMSmB/JO2cxD+hsndTOnOYI\n8BNyFxukYgTICmSn32CELY1ZTnNpDB7u7VZLwZFgOXxJRp5GblddXfW2KOZa0zxW\nf7c+r8mFAgMBAAECggEABgvjtIsuYjmNeqoeXT6yBARxxWc0cz89vKlGHj5CGhVW\nPjGBZlzyxe8l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vObSUlNrA2U+QQiLkygDnxE0VK9qdYK\nN/zsbZZQdTuDSy1NcMJ50h0ed4CrmYn+mJS3rGlj0Ov9vPa4Ppf/E8Of1uwFFiB4\ng3QpbaO3cuvxiu4EHf25Lg==\n-----END PRIVATE KEY-----\n",
"client_email": "firebase-adminsdk-fbsvc@milieu-nantais.iam.gserviceaccount.com",
"client_id": "102638886608570330042",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-fbsvc%40milieu-nantais.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
-3
View File
@@ -8,7 +8,6 @@ import {
clearAllAuth,
} from './tokenStorage';
import { extractUsernameFromToken, extractRoleFromToken, isTokenExpired } from './jwtUtils';
import { removePushTokenFromBackend } from '../services/pushNotifications';
export type UserRole = 'client' | 'admin' | 'cabine' | 'livreur' | null;
@@ -137,8 +136,6 @@ export function AuthProvider({ children }: { children: ReactNode }) {
};
const logout = async () => {
// Supprimer le push token du backend avant de se déconnecter
try { await removePushTokenFromBackend(); } catch { /* silencieux */ }
await clearAllAuth();
setState({
token: null,
+2 -1
View File
@@ -17,8 +17,8 @@ import { useNotifications } from "../context/NotificationContext";
import { useAuth } from "../auth/AuthContext";
import { useTheme } from "../context/ThemeContext";
import { logoutUser } from "../api/api";
import { removePushTokenFromBackend } from "../services/pushNotifications";
import type { ClientNotification } from "../api/api";
import { removePushTokenFromBackend } from "../services/pushNotifications";
import { fontSize, spacing, borderRadius } from "../theme";
import Toast from "../components/ui/Toast";
import type { ClientTabParamList, ClientStackParamList } from "./types";
@@ -76,6 +76,7 @@ function ClientTabs() {
}, [navigateToOrder, navigation, clearNavigateToOrder]);
const handleLogout = async () => {
try { await removePushTokenFromBackend(); } catch { /* silencieux */ }
await logoutUser();
await logout();
};