Is it possible to make a notification expand on click? For example, by clicking on the notification it would bring up a listview with more options.
In the app I'm working on, a user has many files. Each time the app is opened a notification is issued with the number of files that have been modified. Is there any way to click on this notification so I can see a sub-list of each file?
I could do this by registering an intent with a ListActivity, but is there a cleaner way to do it?
Thanks!
Related
Actually the thing I want to achieve is, normally the shortcut icon badge count in android got cleared once the push notification popup is acknowledged by an user from notification panel, but instead clearing the count as above it has to be cleared only after the corresponding notification is acknowledged by an user within the app(for eg: if an user received a text message then the badge count will increased to one and once the user cleared the push notification popup form notification panel then the badge will also got cleared, but instead of that badge should be cleared only after the user viewed the message).
I tried the following packages.
https://www.npmjs.com/package/react-native-app-badge
https://www.npmjs.com/package/react-native-android-badge
Looks like you can use ShortcutBadge.setCount(0); to clear the badge counter!
I dont know what you use to display a notification on the android device itself, probably react-native-push-notification.
If that's the case, they also have a function for it:
PushNotification.setApplicationIconBadgeNumber(0)
You just need to run one of these functions when the event of a dismissed notification triggers, which may or may not need some java coding for achieve it!
I have developed one application that required notification displayed to the user. So I already search on how to create a notification and made it display automatically by setting date and time without using any button to push the notification.Anyone can help me how to solve this problem?
I'm trying to create a custom notification in my android app with an image that will also be visible when the phone is locked.
Right now, Im building push notifications which are visible on the notification bar only, in which only my app icon is visible and on clicking which a certain pending intent is executed.
Is there a way through which i can show, my notifications with an image and a headline with it and also it gets visible on locked screen .
Also is there any widgets available or particular libraries through which i can implement my custom notifications?
Try using alertdialog with a flag. The flag_show_when_locked is the thing you trying to do I suppose. Please refer to this answer here.
I'm building an Android app which creates notifications. Each notification has a number of additional actions.
The default application (when the user taps on the notification) launches an activity in my app. That's working fine.
When the user swipes the notification to dismiss the notification, my app responds by doing some deletion work, and the user is left on the list of notifications. The one that the user swiped is removed from the list.
For some of my additional actions I want to launch activities, and that's working fine; for the other actions, I want my app to do some work but I also want the user to remain on the notification list. I'm struggling to find a way to do this last part - all my attempts to configure the intent and pending intent for my additional action result in behaviour whereby when the user clicks on the action, the notification list disappears.
Is there any way to get what I want (i.e. a notification additional action which performs work but leaves the user on the notification list)? Do I need to build a custom notification layout or something?
My intention is to display a notification with a personalised icon. However, if a notification with the same id is already displayed and then I need to add a new notification with the same id, my program will instead prepare a "stacked" version of the notification where the icon is changed to some generic icon and the notification content shows excerpts from the last and current notifications. Similar to how Gmail does when there are multiple emails.
To implement that I need to check if there are notifications of my app, currently displayed. I do not see any API to retrieve my own notifications.
I cannot simply cache the notification details that I have displayed till now, since in that case I need to know when they will be dismissed by the user, and update my cache accordingly. I also do not see any API to listen for dismiss events.
If you observe the gmail app notification behaviour properly u will notice that even when u dismiss one notification gmail shows you the same notification again in the list when a new notification comes. It looks to me that gmail is relying on total unread/unopened messages rather than keeping a cache of notifications.
There is no direct api for ur suggested SDK version. You need to fallback to ur own implementation. However, there is a way to know if a already showed notification was dismissed - How to know when my notification is cleared via Clear button?
This is possible with android 4.3 upwards now
See http://developer.android.com/reference/android/service/notification/NotificationListenerService.html#getActiveNotifications()