FCM - Are registered token and FID both required? #10274
livefielddev
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Firebase FCM: FID for Direct Notifications vs Token for Topic Notifications
I am implementing Firebase Cloud Messaging (FCM) for a Next.js and I am confused about the current recommended approach for using FID-based personal notifications together with topic-based group notifications.
From the current Firebase documentation, it appears that Firebase is moving toward using the Firebase Installation ID (FID) for direct/personal device targeting.
My requirement is:
Personal notification
↓
FID
Group notification
↓
Topic
For example:
offerstopic.However, I am facing a problem with topic subscriptions.
As I understand it, topic subscription/topic management requires an FCM registration token, while FID cannot be directly used to subscribe to a topic.
The Firebase documentation for topic management also indicates that the older server-side Instance ID API is deprecated.
This leaves me with the following problem:
but:
Therefore, do I need to obtain and maintain both the FID and the FCM registration token for every browser/device?
For example:
{ "fid": "firebase-installation-id", "token": "fcm-registration-token" }The problem
When I try to obtain/register both, I am seeing unexpected behavior.
If I first obtain the FID:
and then obtain the FCM registration token:
the Firebase Installation/FID appears to be unregistered.
In other words, I seem to be unable to maintain both registrations as expected.
This makes me unsure about the correct architecture.
My questions
For a Web application that needs both personal notifications and topic notifications, should I obtain and store both the FID and FCM registration token?
If both are required, how is this supposed to be implemented correctly?
Is it actually possible for the same Firebase Installation to have both:
If yes, why does obtaining the FCM token appear to unregister/change the FID in my implementation?
Is there a specific Firebase Web SDK registration flow that should be used to obtain both without creating/replacing the Firebase Installation?
Since the old server-side Instance ID API for topic management is deprecated, what is the current recommended way to subscribe a Web/PWA installation to a topic?
If FID cannot be used for topic subscription, is the intended architecture actually:
I am specifically looking for the current recommended Firebase architecture, not the deprecated Instance ID API approach.
I would appreciate any clarification or official documentation/code example showing how Firebase expects Web/PWA applications to handle FID + topic subscriptions simultaneously.
All reactions