Unable to get image from whats app notification - android

I am working on the application which reads the data from notification using Notification Listener Service class. I have completed the text part but I am unable to store the image received in the notification.
I want to store images received in the WhatsApp application from the notification. I have tried all most all solutions of Stack Overflow but didn't get any solution. I have tried Notification.EXTRA_PICTURE but it always returns null.
I have seen many applications doing this but looks like I am missing something.
So if anyone could help in any way, it would be much appreciated

You need to use Notification.EXTRA_LARGE_ICON.
On API 23+ there is notification.getLargeIcon() method to get the icon.

Related

Firebase push notification is not working properly when device is offline

I am implement a tap action on the notification and then i found out that when i am offline and triggering the notification. and when i am coming to online i am only receiving the last notification. and it is only happening in android
please help
I have read lot of solution but did not found any proper answer.
I assume you've read this then. Check notification's time to live first, and if you're sure that's not the cause, make sure you're using different notification ids for notifications, otherwise you'll replace the currently shown notification with a new one.
Answered a similar post here. This is working as intended as notification messages are always collapsible.

Android Cancel Notification From Backend

I noticed that some app like messenger clear their notification in phone even I viewed the message from web.I know it can be done by giving ID to notification when showing it and when it needs to be cleared we can send another event via FCM and clear the corresponding notification. Is there a proper way of doing it other than sending another event via FCM because it feels not the proper way of doing it for me.
I hope it will helpful Can you expire / remove a message remotely on FCM?.
Note: due to low reputation I had to use answer section instead of comments.

How to get all notification of all application have custom notification running

I'm a beginner. I have a problem about custom notification.
I want to read all information of normal notification and custom notification use RemoteView.
Example I want get all information about notification music(art cover, song, next, pause, back action)
I search very very much, but can't find the document I need.
If you know, please tell me.
Thank so much!
What you're looking for is a NotificationListenerService. From the docs:
A service that receives calls from the system when new notifications are posted or removed, or their ranking changed.
If you're specifically looking for ways to read Metadata and the music app is using a MediaSessionCompat, you can use MediaControllerCompat.getMetadata() to read the data off of the notification.
To display the actual content of the notification in your app, what you can do is get one of the many RemoteViews from the Notification object you received, then use this answer to display your notification.

How to merge more than one push notification in android?

I have problem with merge more than one notification into one message like whats app gives the notification. I tried with increment "++Notification_Id" that gives me separate notification.
I tried my best but something i can't understand how to do like this.
This should help : http://developer.android.com/training/notify-user/managing.html
Basically you save your current notification id and then update it as you wish.
But some sample code from your app would help.

Are there things like an Android trigger

I have never developed something in Android before, but now my company has put me on a project which includes android.
My question is this: Is it possible to write an application that runs in the background and waits for triggers (if that is the correct word for it). For instance lets say I want my application to do something as soon as you open your emails or as soon as you get an email. Is there some API that I can use to interact with other applications such as Mail. The application does not have to have any GUI, it will literally just push some information notifications on the mail just received or opened.
I don't require a to technical answer, but rather just yes or no, and indeed yes, where can I get more info on it. Also if it is not possible, is there some workaround to achieve this. I have googled it, but most of the links are how to send an email from your application.
Thanks
EDIT: So it can even be triggered when a notification is received. Then I just want to look at the notification and determine if it is an email?
You could register BroadCastReceiver for the actions that you need to be caught

Categories

Resources