Support Article
Unable to send Push Notification from Android Mobile application
SA-72152
Summary
An application with Push Notification is enabled for Android devices. Error occurs while performing Push Notification.
Error Messages
[ ] [TABTHREAD0] [ ] [ABCD:01.01.01] (ations.AggregatingPushNotifier) ERROR xxxx.xxx.com|xx.xx.xx.xx aaaaaaaa - Can't send push notification to GCM server. The reason is: 'Could not post JSON requests to GCM after 4 attempts'
com.pega.pegarules.priv.mobile.pushnotification.PushNotificationException: Can't send push notification to GCM server. The reason is: 'Could not post JSON requests to GCM after 4 attempts'
at com.pega.pegarules.integration.mobile.internal.pushnotifications.sender.GcmSender.send(GcmSender.java:64) ~[printegrint.jar:?]
at com.pega.pegarules.integration.mobile.internal.pushnotifications.AndroidPushNotifier.sendToDevice(AndroidPushNotifier.java:69) ~[printegrint.jar:?]
at com.pega.pegarules.integration.mobile.internal.pushnotifications.BasePushNotifier.sendToDevice(BasePushNotifier.java:281) ~[printegrint.jar:?]
at com.pega.pegarules.integration.mobile.internal.pushnotifications.BasePushNotifier.sendToDeviceGroupped(BasePushNotifier.java:275) ~[printegrint.jar:?]
at com.pega.pegarules.integration.mobile.internal.pushnotifications.BasePushNotifier.sendToUsers(BasePushNotifier.java:264) ~[printegrint.jar:?]
at com.pega.pegarules.integration.mobile.internal.pushnotifications.AggregatingPushNotifier$4.visit(AggregatingPushNotifier.java:118) ~[printegrint.jar:?]
at com.pega.pegarules.integration.mobile.internal.pushnotifications.AggregatingPushNotifier.sendMessage(AggregatingPushNotifier.java:127) ~[printegrint.jar:?]
at com.pega.pegarules.integration.mobile.internal.pushnotifications.AggregatingPushNotifier.sendToUsers(AggregatingPushNotifier.java:114) ~[printegrint.jar:?]
at com.pegarules.generated.activity.ra_action_pysendpushnotification_470d740fae76f9f1fe556949a3341428.step5_circum0(ra_action_pysendpushnotification_470d740fae76f9f1fe556949a3341428.java:659) ~[?:?]
at com.pegarules.generated.activity.ra_action_pysendpushnotification_470d740fae76f9f1fe556949a3341428.perform(ra_action_pysendpushnotification_470d740fae76f9f1fe556949a3341428.java:138) ~[?:?]
at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3586) ~[prprivate.jar:?]
at com.pegarules.generated.activity.ra_action_reloadsection_2a07dae44b0da69c8dd529e9fcfd3cfb.step4_circum0(ra_action_reloadsection_2a07dae44b0da69c8dd529e9fcfd3cfb.java:666) ~[?:?]
at
.
.
.
at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl.invokeEngine(EngineImpl.java:274) ~[prprivate.jar:?]
at com.pega.pegarules.session.internal.engineinterface.etier.impl.EngineImpl.invokeEngine(EngineImpl.java:251) ~[prprivate.jar:?]
at com.pega.pegarules.priv.context.JNDIEnvironment.invokeEngineInner(JNDIEnvironment.java:278) ~[prpublic.jar:?]
at com.pega.pegarules.priv.context.JNDIEnvironment.invokeEngine(JNDIEnvironment.java:223) ~[prpublic.jar:?]
at com.pega.pegarules.web.impl.WebStandardImpl.makeEtierRequest(WebStandardImpl.java:596) ~[prwebj2ee.jar:?]
at com.pega.pegarules.web.impl.WebStandardImpl.doPost(WebStandardImpl.java:385) ~[prwebj2ee.jar:?]
Steps to Reproduce
- Enable Push Notification in the application.
- Rebuild the application for Android.
- Navigate to the Push Notification tab for the build.
- Send a test message.
Root Cause
Google Cloud Platform services are now accessible through Firebase (https://console.firebase.google.com/). Previously the services were accessed through https://console.cloud.google.com/.
Multiple Google Cloud client APIs such as Google Cloud Messaging (GCM) have moved to the Firebase brand.
Resolution
Perform the following local-change:
- Create a new server key through Firebase.
- Use the 'Legacy Server Key' when updating the certificate ruleset in the application.
Perform the below steps,
- With any server key generated on https://console.cloud.google.com/, switch to https://console.firebase.google.com/.
- Create a new project and use the new 'old server key' and sender ID (click the gear icon next to Project Overview).
Published February 20, 2019 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.