Skip to content

Commit

Permalink
Handle case of null fcmtoken
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatrakazas committed Mar 14, 2024
1 parent a5c4173 commit 232b0f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ export const fetchToken = async () => {
} else {
console.log('Failed to retrieve token. Trying to re-register service worker.');
const newToken = await reRegisterServiceWorkerAndGetToken(); // Re-register service worker and fetch token
if (newToken === null) {
console.log('FCM Token null case');
return fetchToken();
}
if (newToken) {
return newToken;
} else {
Expand Down

0 comments on commit 232b0f4

Please sign in to comment.