handle push token fetch failures

This commit is contained in:
Samuel Newman
2026-09-07 11:57:56 +03:00
parent 3d39ca0c0c
commit 422abf3729
+5 -1
View File
@@ -120,7 +120,11 @@ async function getPushToken() {
const granted = (await Notifications.getPermissionsAsync()).granted
notyLogger.debug(`getPushToken`, {granted})
if (granted) {
return Notifications.getDevicePushTokenAsync()
try {
return await Notifications.getDevicePushTokenAsync()
} catch (error) {
notyLogger.debug(`getPushToken: failed`, {safeMessage: error})
}
}
}