fix: project id notifications

This commit is contained in:
Fredrik Burmester
2025-11-11 11:28:39 +01:00
parent 5765793d79
commit 38aba3d67a
2 changed files with 14 additions and 7 deletions

View File

@@ -129,10 +129,7 @@
"expo-notifications",
{
"icon": "./assets/images/notification.png",
"color": "#9333EA",
"android": {
"projectId": "streamyfin-4fec1"
}
"color": "#9333EA"
}
],
"expo-web-browser",

View File

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