From 38aba3d67aae8767b436b7bc9aa780cd0cf60980 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Tue, 11 Nov 2025 11:28:39 +0100 Subject: [PATCH] fix: project id notifications --- app.json | 5 +---- app/_layout.tsx | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app.json b/app.json index ab7b20e1..8c067db7 100644 --- a/app.json +++ b/app.json @@ -129,10 +129,7 @@ "expo-notifications", { "icon": "./assets/images/notification.png", - "color": "#9333EA", - "android": { - "projectId": "streamyfin-4fec1" - } + "color": "#9333EA" } ], "expo-web-browser", diff --git a/app/_layout.tsx b/app/_layout.tsx index 11bc63a6..cb6eb341 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -255,9 +255,19 @@ function Layout() { // only create push token for real devices (pointless for emulators) if (Device.isDevice) { - Notifications?.getExpoPushTokenAsync() - .then((token: ExpoPushToken) => token && setExpoPushToken(token)) - .catch((reason: any) => console.log("Failed to get token", reason)); + Notifications?.getExpoPushTokenAsync({ + projectId: "e79219d1-797f-4fbe-9fa1-cfd360690a68", + }) + .then((token: ExpoPushToken) => { + if (token) { + console.log("Expo push token obtained:", token.data); + setExpoPushToken(token); + } + }) + .catch((reason: any) => { + console.error("Failed to get push token:", reason); + writeErrorLog("Failed to get Expo push token", reason); + }); } }, [user]);