Skip to content

feat(notification): implement device token registration#1763

Open
mrlnstk wants to merge 20 commits intomainfrom
feat/implement-device-registration
Open

feat(notification): implement device token registration#1763
mrlnstk wants to merge 20 commits intomainfrom
feat/implement-device-registration

Conversation

@mrlnstk
Copy link
Copy Markdown
Member

@mrlnstk mrlnstk commented Feb 6, 2025

📚 Description

Add an event handler that requests and sends the current device token to the server for storage.

On initial load: Add / Update token
On visibility change (app gets in focus / is reopened): Add / Update token

The token is not sent if the user isn't logged in or didn't grant the permission.

Todo:
Add connection to backend

See the docs for token management here: https://firebase.google.com/docs/cloud-messaging/manage-tokens

📝 Checklist

  • The PR's title follows the Conventional Commit format

Usage

If you want to integrate it into the app flow consider the following:

  1. Request notification permissions some way or another.
  2. Once the user granted the permission, call await notificationStore.fcmTokenInitialize()
  3. Everything else will happen automatically

@mrlnstk mrlnstk marked this pull request as draft February 6, 2025 11:09
@dargmuesli dargmuesli force-pushed the master branch 2 times, most recently from db8592b to 95ec293 Compare February 20, 2025 05:59
@dargmuesli
Copy link
Copy Markdown
Member

@myyxl backend migration is done and deployed.

# Conflicts:
#	src/shared/utils/auth.ts
@dargmuesli dargmuesli changed the base branch from master to main March 7, 2025 10:28
@dargmuesli dargmuesli changed the title feat(device-token): implement device registration feat(notification): implement device token registration Apr 3, 2025
@@ -1,6 +1,6 @@
/* eslint-disable no-use-before-define */
import { cacheExchange } from '@urql/exchange-graphcache'
import type {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type must stay

@@ -1,4 +1,4 @@
import type { IntrospectionQuery } from 'graphql'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type must stay here too

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jun 28, 2025

CLA assistant check
All committers have signed the CLA.

@mrlnstk mrlnstk marked this pull request as ready for review July 17, 2025 15:22
@dargmuesli dargmuesli linked an issue Jul 30, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: implement notifications

3 participants