Class DesktopNotifications
java.lang.Object
com.codename1.desktop.DesktopNotifications
Shows a native desktop notification now. It is a shortcut over
LocalNotification: the notification goes through the same port path,
and a click on it reaches the application's LocalNotificationCallback
with the identifier given here. Mobile platforms answer false from
#isSupported(); LocalNotification itself still works there.
if (DesktopNotifications.isSupported()) {
DesktopNotifications.show("build-done", "Build finished", "All tests passed");
}
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidRemoves a notification shown by#show(String, String, String).static booleanTrue when the platform shows native desktop notifications.static voidsetImplementation(com.codename1.impl.CodenameOneImplementation impl) Invoked internally from Display, this method is for internal use onlystatic LocalNotificationShows a notification now.
-
Method Details
-
setImplementation
public static void setImplementation(com.codename1.impl.CodenameOneImplementation impl) Invoked internally from Display, this method is for internal use only
Parameters
impl: implementation instance
-
isSupported
public static boolean isSupported()True when the platform shows native desktop notifications.
Returns
true on a desktop platform with notifications
-
show
Shows a notification now.
Parameters
id: the identifier the click callback receivestitle: the titlebody: the body text
Returns
the notification that was scheduled, or null when not supported
-
dismiss
Removes a notification shown by
#show(String, String, String).Parameters
id: its identifier
-