2.9 KiB
2.9 KiB
title | description | type | page_title | slug | position | tags | teampulseid | ticketid | pitsid |
---|---|---|---|---|---|---|---|---|---|
Push Notifications to Android Stopped Working | Sending push notifications to Android throws "Error authenticating to Google Cloud Messaging" | troubleshooting | Unsuccessful authentication to Google Cloud Messaging | troubleshooting-android-push-notifications-stopped-working | Google Cloud Messaging, GCM, Android, push notifications, FCM | 1044096, 1045723 |
Environment
Service | Notifications (Backend Services) |
Feature | Push Notifications, Android |
Description
Your Android app suddenly stopped receiving push notifications. The {{site.tp}} portal shows the following error message in the details pane for the failed push notification: Error authenticating to Google Cloud Messaging server.
Error Message
Error authenticating to Google Cloud Messaging server.
Cause
The error signifies that {{site.tp}} cannot authenticate to Google Cloud Messaging (GCM). Due to recent changes in the GCM infrastructure, the Google API key that you entered in {{site.tp}} may no longer be accepted by Google for authentication to GCM.
Solution
Verify that the Google API key entered in {{site.tp}} for your app is a Server API key.
Check the type of your Android API key:
- Open the Google Developers console.
- From the projects list select your project—look for the number used to subscribe the mobile app for push notifications (passed as
senderId
in the mobile app). - On the left, click Credentials.
- In the API keys list, find the Google API key used in {{site.tp}}.
- Verify that the key type is Server. Other key types such as Android, Browser, or iOS are not supported.
- If the key type is not Server, issue a Server API key and enter it in {{site.tp}}. Take these steps:
- On the Credentials screen of your project in the Google Cloud Console, click Create credentials.
- From the list of available credentials types, choose API key.
- Select the Server key option (other key types are not supported).
- Name the key as you find appropriate.
- Leave the IP addresses field blank.
The key will reside in {{site.tp}} and will not be exposed to third parties. It is used only in the server-to-server communication between {{site.tp}} and GCM. - Click Create.
- Copy the generated key and paste it in your {{site.tp}} app in Notifications > Push Notifications > Push Settings > Android.
- Save the Settings.
- Test your setting by sending a push notification.