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 年前檢視次數 416 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南