Support Article
Unable to send Push Notification on custom Android application
SA-93502
Summary
Unable to trigger Push Notification (PN) on a custom Android application. The Status displays as Not Registered in the Push console.
Error Messages
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)
at com.pega.pegarules.integration.mobile.internal.pushnotifications.AndroidPushNotifier.sendToDevice(AndroidPushNotifier.java:69)
at com.pega.pegarules.integration.mobile.internal.pushnotifications.BasePushNotifier.sendToDevice(BasePushNotifier.java:281)
at com.pega.pegarules.integration.mobile.internal.pushnotifications.BasePushNotifier.sendToDeviceGroupped(BasePushNotifier.java:275)
at com.pega.pegarules.integration.mobile.internal.pushnotifications.BasePushNotifier.sendToApplication(BasePushNotifier.java:257)
at com.pega.pegarules.integration.mobile.internal.pushnotifications.AggregatingPushNotifier$3.visit(AggregatingPushNotifier.java:107)
at com.pega.pegarules.integration.mobile.internal.pushnotifications.AggregatingPushNotifier.sendMessage(AggregatingPushNotifier.java:127)
at com.pega.pegarules.integration.mobile.internal.pushnotifications.AggregatingPushNotifier.sendToApplication(AggregatingPushNotifier.java:103)
Steps to Reproduce
- Set up a Pega 7.2.2 instance
- Build HC7 for Android with the Push Notification support
- Run the application
- Log in to Designer Studio
- Send Push Notification
Root Cause
Google Cloud Messaging (GCM) service is deprecated and removed from use on 11th April, 2019. Migration from GCM to Firebase Cloud Messaging (FCM) is performed before 11th April, 2019.
Resolution
Apply HFix-57816.
Published January 3, 2020 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.