firebase / firebase/firebase-admin-go
SubscribeToTopic() results in 401
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 274
- Avg merge
- 10h 39m
- Merged PRs (30d)
- 2
Description
### [REQUIRED] Step 2: Describe your environment
* Operating System version:
```
$ uname -a
Linux Chicago 5.15.79.1-microsoft-standard-WSL2 #1 SMP Wed Nov 23 01:01:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
```
* Firebase SDK version: firebase.google.com/go/v4 v4.10.0
* Library version: v4.10.0
* Firebase Product: messaging
### [REQUIRED] Step 3: Describe the problem
#### Steps to reproduce:
```
app, err := firebase.NewApp(context.Background(), &firebase.Config{
ProjectID: projectID,
})
fcm, err := app.Messaging(context.Background())
if err != nil {
panic(err)
}
...
fcm.SubscribeToTopic(context.Background(), []string{
"",
}, "anyTopic")
```
Results in the error:
```
unexpected http response with status: 401\n\n\nUnauthorized\n\n\n
Unauthorized
\nError 401
\n\n\n```
Inspecting this further, based on the documentation here: https://developers.google.com/instance-id/reference/server#manage_relationship_maps_for_multiple_app_instances
I would expect that `/iid/v1:batchAdd` gets called with the corresponding parameters. However, it doesn't have an authorization header.

Did I miss something super obvious in configuration?
Contributor guide
Assessment
This issue has not been assessed yet.