Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

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

  1. Enable Push Notification in the application.
  2. Rebuild the application for Android.
  3. Navigate to the Push Notification tab for the build.
  4. 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:
  1. Create a new server key through Firebase.
  2. Use the 'Legacy Server Key' when updating the certificate ruleset in the application.
For issues with connecting to GCM services, Google has deprecated GCM and recommends migrating to Firebase Cloud Messaging (FCM).

Perform the below steps,
  1. With any server key generated on https://console.cloud.google.com/, switch to  https://console.firebase.google.com/.
  2. Create a new project and use the new 'old server key' and sender ID (click the gear icon next to Project Overview).

Additionally, customize .pyHCBuildVersion to override to the current Hybrid Client version forcefully.
 
Suggest Edit

Published February 20, 2019 - Updated December 2, 2021

Did you find this content helpful? Yes No

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us