Skip to content

gcm: fix instance ID registration field - #3

Open
iFixRobots wants to merge 1 commit into
mainfrom
codex/gcm-instance-id-field
Open

gcm: fix instance ID registration field#3
iFixRobots wants to merge 1 commit into
mainfrom
codex/gcm-instance-id-field

Conversation

@iFixRobots

Copy link
Copy Markdown

Problem

GCM registration sends the instance ID under a field Google does not use.

Fix

Use the lowercase appid field Chromium sends.

Notes

Verified token issuance with the existing UUID instance ID and corrected field. go build -mod=readonly ./... and go vet -mod=readonly ./... pass.

@indent

indent Bot commented Sep 12, 2026

Copy link
Copy Markdown
PR Summary

Fixes GCM registration so the caller-supplied InstanceID is sent under the field name Google actually reads. RegisterGCM was setting the form key appId (camelCase), which the server ignores, so the InstanceID was effectively dropped from registration; it now sends lowercase appid, matching what Chromium sends.

  • gcm.go: change the registration form key from appId to appid for opts.InstanceID.

Verified against Chromium's instance_id_get_token_request_handler.cc, which declares kInstanceIDKey = "appid". This is the only usage of that key in the repo, and no in-repo consumer depends on the old name (the json:"appId" tag in fcm.go is unrelated response serialization).

Issues

No issues found.

CI Checks

All CI checks passed on 8037f51.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant