0
votes

I was using GCM services from past 1 year, it was working very well. But it started throwing error from 30th September. First it started throwing 443 time out error, but after few days now it's throwing Unauthorized 401 error. It's not delivering even a single push now.

I have an Android app and using PHP-MYSQL server for sending push notification. It does not seem to be an API_KEY issue as I checked with some online test sites(http://apns-gcm.bryantan.info/), push notification is being delivered successfully.

I am planning to migrate to FCM now, but what about my existing GCM users? How can I send push to them?

2

2 Answers

1
votes

This issue has been known for quite sometime. See my full answer here for more details. But on a short answer, below are the details you need.

There is a visible note in the GCM docs saying:

Starting from Sept. 2016 new server key can only be created in the Firebase Console using the Cloud Messaging tab of the Settings panel. Existing projects that need to create a new server key can be imported in the Firebase console without affecting their existing configuration.

It would also seem that Migrating from GCM to FCM fixes the issue for 401 Unauthorized Error.

If you are just starting to use GCM, instead of creating a project in the Google Developers Console, do it in the Firebase Console. After creating the project, simply use the auto-generated Server Key. Here are the steps where to find the Server Key:

  1. Go to your Firebase Console and click on CREATE NEW PROJECT.
  2. Fill in your desired Project Name and select your Country. After this, the new Project should be active.
  3. Then on left-side panel, click on the gear button and select Project Settings.
  4. Then go to the Cloud-Messaging Tab.

For old GCM projects, you can simply Import the project to the Firebase Console:

  1. Go to your Firebase Console and click on IMPORT PROJECT.
  2. Select the project you want to import and your country.
  3. Click on ADD FIREBASE. After this, the new Project should be active.
  4. Then on left-side panel, click on the gear button and select Project Settings.
  5. Then go to the Cloud-Messaging Tab.

For your GCM users, you don't have to worry so long as you have saved the registration tokens. So long as you use the corresponding Sender ID to send the push, FCM should still work with GCM.

0
votes

On 30th September GCM is deprecated and FCM is new cloud messaging service. So you remove GCM and use FCM.

Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits the reliable and scalable GCM infrastructure, plus new features! See the FAQ to learn more. If you are integrating messaging in a new app, start with FCM. GCM users are strongly recommended to upgrade to FCM, in order to benefit from new FCM features today and in the future.

Here link of FCM Docs