Skip to content

Commit

Permalink
Do not try to add push token for web (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
adelinaenache authored Jun 5, 2024
1 parent 1d72d9e commit c5092dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function registerForPushNotificationsAsync() {
});
}

if (Device.isDevice) {
if (Device.isDevice && Platform.OS !== "web") {
const { status: existingStatus } =
await Notifications.getPermissionsAsync();
let finalStatus = existingStatus;
Expand Down Expand Up @@ -50,6 +50,6 @@ export async function registerForPushNotificationsAsync() {
handleRegistrationError(`${e}`);
}
} else {
handleRegistrationError("Must use physical device for push notifications");
throw new Error("Must use physical device for push notifications");
}
}

0 comments on commit c5092dc

Please sign in to comment.