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]);