0

I have used gcm demo code for viewing working of different features of gcm.But unfortunately it is showing some error.My client side is gcm quickstart code ,which is working finely,successfully sent notification using command code(gcm sender) .But i have few doubts-

  1. Is it possible to send message/notification from gcm demo code to gcm quickstart?

2.I have used sender id and api key of gcm quickstart for sending notification from gcm demo.

3.Is there any correction required in gcm demo?

enter image description here

Uma Kanth
  • 5,659
  • 2
  • 20
  • 41
coder
  • 9
  • 2

1 Answers1

0

As GCM Reference 401 is authentication issue and possible problems are explained below;

The sender account used to send a message couldn't be authenticated. Possible causes are:

  • Authorization header missing or with invalid syntax in HTTP request.
  • Invalid project number sent as key.
  • Key valid but with GCM service disabled.
  • Request originated from a server not whitelisted in the Server Key IPs.

Check that the token you're sending inside the Authentication header is the correct API key associated with your project. See Checking the validity of an API Key for details.

Yusuf K.
  • 4,195
  • 1
  • 33
  • 69