Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to add video in android push notification?

Is ti possible too embedded video into android rich notification as it possible in iOS? I know that the android officially still do not support that, but it may be some tricky way to improvise that? :)

Thanks in advance.

like image 565
Dragisa Dragisic Avatar asked Aug 22 '18 10:08

Dragisa Dragisic


People also ask

Can we send GIF in push notification?

GIFs are not supported by Android and are rendered as static images in a Push Notification.

Can you add images to push notifications?

Large Images for Mobile Push Notifications can be added on iOS and Android.

How do I add a photo to a notification on Android?

To add an image in your notification, pass an instance of NotificationCompat. BigPictureStyle to setStyle() .


2 Answers

There is no way to show video on RemoteViews. You can use only widgets that are described in the official documentation

As you show in comments as example, it's not a video in the notification, it's a simple image (but as I assume, when you click on it, some apps, that can show video by URL (or something like that), will be started and showing you content, that's all)

like image 174
HeyAlex Avatar answered Sep 29 '22 01:09

HeyAlex


You have to implement FCM Messages 'Data message'. This will allow you to send custom json data. More info here: FCM documentation. Such message will not be shown automatically - after receiving you need to build your custom notification layout. More info here: Android dev documentation It's not possible to show video directly on notification panel. Checkout how youtube does it.

like image 41
3mpty Avatar answered Sep 29 '22 03:09

3mpty