Questions tagged [notifications]

A notification is a user interface element displayed to indicate an event has occurred.

A notification is a user interface element displayed to indicate an event has occurred.

Notifications typically occur in a designated area of an application's UI, such as an icon appearing in a status bar or an alert message.

15974 questions
36
votes
5 answers

Event OnClick for a button in a custom notification

I have a custom notification with a button. To set the notification and use the event OnClick on my button I've used this code: //Notification and intent of the notification Notification notification = new…
Simone
  • 795
  • 2
  • 7
  • 17
36
votes
3 answers

How to close the status bar/notification panel after notification button click

I've browsed through Stackoverflow and have seen that this question has been asked, but I didn't find any solution. I have a custom notification with 2 buttons. I want the status bar panel to close after I press a button on that notification, but…
Toni Kanoni
  • 2,265
  • 4
  • 23
  • 29
36
votes
3 answers

java.lang.SecurityException: Requires VIBRATE permission on Jelly Bean 4.2

Since yesterday I have an issue on Android 4.2 when I receive push notifications it requires the permission even if i don't set it to vibrate Notification notification = new Notification(icon, notificationItem.message,…
Ste
  • 2,116
  • 7
  • 24
  • 24
35
votes
2 answers

FCM remote notifications payload for iOS and Android

We are using FCM to send remote notifications for both iOS and Android. The following are the payloads we are sending from the backend. options = { notification: { title: "title", body: body, sound: 'default' …
35
votes
3 answers

CSS notification style badge over image

I'm attempting to place a 'notification' style badge over an images. I am using Twitters Bootstrap as a base framework and creating a custom CSS class called notify-badge. But I cannot get anything to line up properly. Through the magic of…
user-44651
  • 3,924
  • 6
  • 41
  • 87
35
votes
4 answers

How does Facebook Messenger clear push notifications from the lock screen if you’ve read them on desktop?

When I receive a message on Facebook I get a push notification on a lock screen (iOS). Then I read this message on desktop. Right after that this push notification disappear without any interactions with the phone. How can I implement the same thing…
35
votes
6 answers

Implement expand and collapse notification android

I need to implement expand and collapse notification in status bar for android 4.0 and above version. I have search on google for this but didn't getting any code solution for implementation does anybody have I idea how to implement this Thank You…
Pratik
  • 30,639
  • 18
  • 84
  • 159
35
votes
2 answers

How to execute a method by clicking a notification

I have an application with two buttons. One button that "closes" the application and one that begins the algorithm. When I click "begin" it "hides" the application and displays a notification in the notification bar. I need to be able to…
AnDev
  • 351
  • 1
  • 3
  • 4
34
votes
4 answers

Start Service from Notification

is it possible to start a service from a notification. The normal way of starting an activity is working perfectly, but I need some pre checks of data before actually starting the app. I've tested it with including a valid service in the…
AlexVogel
  • 10,601
  • 10
  • 61
  • 71
34
votes
4 answers

Make browser tab flash a notification

For security reasons, my website automatically signs users out after 5 minutes of inactivity. I achieve this through jquery timeouts which are reset any time the user does what I consider an "activity". To ensure security, the timeout of the…
Josh
  • 16,286
  • 25
  • 113
  • 158
34
votes
16 answers

How to get One Signal unique user id in Mobile?

I am developing a restaurant app. I am using One Signal in my app to send notifications. Here while I place the order I need to send the unique Id of the one signal for a specific user for getting notification of "Your Order is placed…
Parama Sudha
  • 2,583
  • 3
  • 29
  • 48
34
votes
1 answer

How to trigger a notification from the command line in OSX Yosemite?

Is there a native-way in OSX to trigger a notification, other than using https://github.com/julienXX/terminal-notifier?
onassar
  • 3,313
  • 7
  • 36
  • 58
34
votes
4 answers

How to add a notification badge/count to application icon on Sony Xperia devices?

With Sony's Xperia Home, certain apps have the ability to display a count bubble or badge on the app icon. Facebook and Facebook Messenger both do this, as well as the built in Email app. This has been solved for Samsung's launcher, but I have not…
Marcus
  • 1,619
  • 1
  • 16
  • 22
33
votes
2 answers

In which method should I handle iOS remote notification?

I know similar questions have been asked many times. But it is still very confusing to me after reading those threads, especially after UNUserNotificationCenter is introduced in iOS 10. The official documentation mentioned 3 methods where I can…
NeoWang
  • 17,361
  • 24
  • 78
  • 126
33
votes
4 answers

how does a service return result to an activity

I seem to have a classic task, yet I can't find any examples on how to do it. I want to download something. Well I call a web service and get a response... but it's pretty much the same. In order to do this I have an activity that starts a service…
Alex Poke
  • 535
  • 2
  • 7
  • 16