Plugin Notification Ballon not visible.
Hi,
i'am writing a Plugin for PhpStorm that should display Notification Ballons. But my Problem is the Notifications are only in the Log.
here are the relevant code:
public class Poll implements StartupActivity {
private NotificationGroup pollNotifications;
@Override
public void runActivity(@NotNull Project project) {
pollNotifications = new NotificationGroup("Push Notifications", NotificationDisplayType.STICKY_BALLOON, true);
// NotificationListener is a Thread
NotificationListener client = new NotificationListener(remote, userEmail, new ReceiveHandler() {
@Override
public void receive(NotificationListener listener, String data) {
...
displayNotification(title, content, t);
}
}
client.start();
}
synchronized private void displayNotification(String title, String message, NotificationType type) {
Notifications.Bus.notify(pollNotifications.createNotification(title, message, type, null));
}
}
irrelevant try catch IOException is removed.
请先登录再写评论。
Hey,
On the first glance, everything's fine. Is there something interesting in log files? Also, did you try to invoke a simple code like the following? Does it work?
NotificationGroup group = new NotificationGroup("Push Notifications", NotificationDisplayType.STICKY_BALLOON, true);group.createNotification("Title", "Message", NotificationType.INFORMATION, null).notify(null);
Same issue here. Any idea how to fix it?
Dfzuluaga please create a new thread and describe your problem and provide sample code