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
질문됨 일 년 전419회 조회
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
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠