Controlling Android push notifications with Pinpoint

0

I've set up an Android app to receive push notifications using Amplify and Pinpoint. I followed the directions step by step.

I do receive notifications, but there are a couple of problems.

One, the icon associated with the notification is a generic Android icon instead of my app's icon.

Two, and more importantly, the notifications do not appear if my app is open when the notification is sent. I've implemented Android notifications in the past without using an external framework, and I know that what I need to be doing is overriding the onMessageReceived method of FirebaseMessagingService. However in this case, I'm using a subclass of FirebaseMessagingService provided by Amplify, which is called FCMPushNotificationService. I thought I could just extend FCMPushNotificationService and override onMessageReceived, but I cannot, because FCMPushNotificationService is a final class.

So what I need is either (a) some other way to get a callback when a notification arrives, or (b) a way to configure FCMPushNotificationService in such a way that it displays notifications even when the app is open.

Ideas?

Frank
asked a year ago395 views
1 Answer
0

I had to write a lot of code, but I was able to intercept the notification in the case where my app is open and re-post it as a new notification. So the main problem is resolved.

I'm still flummoxed by the other problem though. I can fill in the "Android Image" field in Pinpoint and that does add an image to my message, but it doesn't change the icon, just adds it as an additional image.

Frank
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions