feat(fcm): Enable fid and deprecate token for Send API#525
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for Firebase Installation IDs (FIDs) in Firebase Cloud Messaging (FCM) by adding the Fid property to Message and the Fids property to MulticastMessage, while deprecating the older Token and Tokens properties. It updates validation, copying, and serialization logic to support these new fields, adds comprehensive unit and integration tests, and suppresses deprecation warnings where necessary. The review feedback suggests improving consistency in exception messages by capitalizing property names (Tokens and Fids) and ensuring proper punctuation.
There was a problem hiding this comment.
Shall we update the comments for SendEachForMulticastAsync to mention the message response order in BatchResponse when both Tokens and FIDs are set in MulticastMessage?
There was a problem hiding this comment.
Sure! Updated comments for both SendEachForMulticastAsync and SendMulticastAsync
There was a problem hiding this comment.
Could we update this test file to include some tests using fid messages?
There was a problem hiding this comment.
MessageTest.cs is already handling the payload serialization/deserialization logic for FIDs. FirebaseMessagingClientTest.cs is responsible for testing the HTTP transport layer. It typically uses a generic Topic or Token payload just as a dummy placeholder to verify that the HTTP request is built correctly. Since we already have full FID coverage in MessageTest.cs and the FirebaseMessagingTest.cs integration tests, it seems a bit redundant to add some tests using fid messages in FirebaseMessagingClientTest.cs. But please let me know if you'd still prefer I add a dummy FID payload test there for completeness!
…SendMulticastAsync
This change deprecates
Token(inMessage) andTokens(inMulticastMessage) as message targets, transitioning support toFid(Firebase Installation ID) andFidsas the primary targets instead.Legacy token tests are wrapped in Method-Level #pragma warning disable CS0618 to prevent compiler warnings and build crash and #pragma wrappers are explicitly maintained for snippet documentation code to allow compiling flawlessly.