Skip to content

AndroidConfig.Notification.ChannelId field mapping mismatch between API Explorer and Go SDK #688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
batumento opened this issue Apr 16, 2025 · 1 comment

Comments

@batumento
Copy link

Problem:

  • In the API Explorer for FCM REST API (projects.messages/send), the example request body shows the JSON field for AndroidConfig.Notification.ChannelId as "channelId"
  • However, in the Go SDK, this field is mapped as "channel_id" in the struct tags
  • Due to this inconsistency, when using the Go SDK, the notification channel ID is not properly transmitted to FCM, making it impossible to change notification sounds through this field

Proposed Solution:

  • Update the json tag in AndroidConfig.Notification structure from "channel_id" to "channelId" to match the API specification
  • Add tests to verify the fix works while maintaining backward compatibility

The mismatch can be verified at: https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages/send
(See the "Try this API" section where the API Explorer shows the correct field name)

@google-oss-bot
Copy link
Collaborator

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants