I\'m getting many 401
Unauthorized errors when trying to connect to Google Cloud Message Server.
Our code was working for some time on
It might happen that IPv6 is used for the connection while only IPv4 is allowed. Make sure you have 'Any IP allowed' not just IPv4 0.0.0.0/0.
After many checks and not finding a good result the only solution we could give was to create a new project (the 3rd one because we did it already before) with a new API key, and this 3rd time it works.
I have solved my problem by creating new API Key under same project. Following this
Go to Google developer console then Select project Credentials -> Create Credentials -> API Key -> Server Key then add your server ip address where your GCM server code hosted.
After creating Api key it may takes 5 minutes to be workable