Skip to content

Commit

Permalink
Enabel firebase
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolaj-pirog committed May 21, 2023
1 parent 418e803 commit 1e3b2d5
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions src/utils/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,24 @@ export function isTestingEnv() {
}

export async function verifyFCMToken(fcmToken) {
// if (isTestingEnv()) {
// // We don't want to verify tokens when testing
// return true
// } else {
// let sentSuccessfully = true
// await admin
// .messaging()
// .send(
// {
// token: fcmToken,
// },
// true
// )
// .catch(() => {
// sentSuccessfully = false
// })
// return sentSuccessfully
// }
return true
if (isTestingEnv()) {
// We don't want to verify tokens when testing
return true
} else {
let sentSuccessfully = true
await admin
.messaging()
.send(
{
token: fcmToken,
},
true
)
.catch(() => {
sentSuccessfully = false
})
return sentSuccessfully
}
}

export async function sendFirebaseMessage(message: Message) {
Expand Down

0 comments on commit 1e3b2d5

Please sign in to comment.