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
已提问 1 年前415 查看次数
1 回答
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
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则