-
public class RichPushHandlerHelper for building rich push notifications with images. Used by AppDNAMessagingService to display BigPictureStyle notifications.
SPEC-070-A H.21 — small-icon resolution delegated to NotificationIconResolver so the icon priority chain stays in lockstep with AppDNAMessagingService.
SPEC-070-A H.21b — server-supplied
channel_importanceoverrides the defaultIMPORTANCE_HIGHwhen the channel is created here.SPEC-070-A H.23 — bitmap download moved off the FCM listener thread into a coroutine with an 8-second wall-clock cap (well under FCM's 10s service window). Previously, the default URL connection's 25s combined timeout could cause the FCM service to be killed before the notification posted.
SPEC-070-A E.6 — rich-media handling for GIF and video URLs:
GIF: FCM/NotificationCompat.BigPictureStyle only renders a single still bitmap, so we decode the first frame of the GIF and surface it as the BigPicture. (Animated rendering inside the notification shade isn't supported by the platform.)
Video (MP4 / MOV / WEBM …): we pull the closest sync frame near t=0 via MediaMetadataRetriever and use that as the BigPicture thumbnail.
The selection between paths is driven by the optional
mediaTypeargument (mapped from FCMdata.media_type) with a filename-extension fallback so the server can omit the field for backward compatibility.
-
-
Field Summary
Fields Modifier and Type Field Description public final static RichPushHandlerINSTANCE
-
Method Summary
Modifier and Type Method Description final NotificationCompat.BuilderbuildRichNotification(Context context, String channelId, String title, String body, String imageUrl, String mediaType, String customSound)final UnitensureChannel(Context context, String channelId, String channelName, Integer importance, String description, String group)SPEC-070-A H.21b — overload that accepts server-supplied importance. -
-
Method Detail
-
buildRichNotification
final NotificationCompat.Builder buildRichNotification(Context context, String channelId, String title, String body, String imageUrl, String mediaType, String customSound)
-
-
-
-