Gcm Http Error 401: Unauthorized
Solution 1:
Check if ports 5228-5230(GCM ports) are open in the new server. It could be the problem.
Solution 2:
The issue can be beacause you are using the old server api key for the new server as well. For sending the push notification from server side, you need the api key generated with the help of server's public IP address.
Solution 3:
If it is testing purposes, make sure your server API key on the google console has the relevant ip addresses in the whitelist: 0.0.0.0/0 ::/0
These are for ipv4 and ipv6 ips
Solution 4:
Since this is an older question that was never answered but still gets views, I'll post here that this issue may have been obsoleted as the Cloud Console has gone through a couple of iterations since then.
Also, Google Cloud Messaging has been superseded by Firebase Cloud Messaging. New projects should use FCM, and existing projects are encouraged to upgrade in order to benefit from new features.
Firebase Cloud Messaginghttps://firebase.google.com/docs/cloud-messaging/
Post a Comment for "Gcm Http Error 401: Unauthorized"