firebase / firebase-admin-go

Firebase Admin Go SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

oauth2: cannot fetch token

redloveling opened this issue · comments

i get an err

unknown error while making an http call: Post "https://fcm.googleapis.com/v1/projects/ghgame001/messages:send": oauth2: cannot fetch token: Post "https://oauth2.googleapis.com/token"

my code
`
ctx := context.Background()
app, err := firebase.NewApp(ctx, nil)
if err != nil {
log.Fatalln(err)
}

fcm, err := app.Messaging(ctx)
if err != nil {
	log.Fatalln(err)
}
token := "dVx1GC0taEhOo7om0EzZra:APA91bFyILOW0CFIYBjwIOAfg5AYlDQAowNbXfA4vDMQHOj3vnmhUETsNpup3NP2L_9JLSi4EmY_wiQYueaCWn3q2fgqeVq1iphq6l3frd06uQCKrswzUsdz1pl8rSTJykgOC_HgqIsE"

m := messaging.Message{
	Data: map[string]string{
		"temp":     "58.0F",
		"humidity": "47",
		"wind":     "18mph",
	},
	Token: token,
}
resp, err := fcm.SendDryRun(ctx, &m)
if err != nil {
	log.Fatalln(err)
}
log.Println("Message verified:", resp)`

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.

Hi, our integration tests and nightly builds do not show any issues on this API. If you are still experiencing this issue please provide us with a minimal repro so we can take a look at it. Thanks!

thanks, my local proxy is wrong