public class LocalNotificationHelper
extends java.lang.Object
| Constructor and Description |
|---|
LocalNotificationHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
cancel(int notificationId)
Cancels a notification with particular
|
static void |
cancel(LocalNotification notification)
Cancels the given
|
static void |
cancelAll()
Cancels all the scheduled notifications
|
static void |
destroy()
Deprecated.
|
static void |
getAll(LocalNotificationHandler callback)
Returns the list of all
LocalNotifications which
are scheduled and going to trigger in future in |
static java.util.List<LocalNotification> |
getAllSync()
Returns the list of all
LocalNotifications which
are scheduled and going to trigger in future in |
static void |
init(java.lang.String defaultTitle,
int defaultIcon)
call this method in 'onCreate' of your Application or Activity class
|
static void |
isScheduled(int notificationId,
LocalNotificationStatusHandler callback)
Returns the status of a notification scheduled on
|
static boolean |
isScheduledSync(int notificationId)
Returns the status of a notification scheduled on
|
static void |
schedule(int notificationId,
java.lang.String channelId,
int smallIcon,
int largeIcon,
java.lang.String textTitle,
java.lang.String textContent,
long delay,
boolean isRepeat)
Schedules a new local notification and overrides if the
same notification is scheduled with same 'notificationId'
|
static void |
schedule(int notificationId,
java.lang.String textContent,
long delay,
boolean isRepeat)
Schedules a new local notification and overrides if the
same notification is scheduled with same 'notificationId'
|
public static void init(java.lang.String defaultTitle,
@DrawableRes
int defaultIcon)
defaultTitle - - Text you want to show by default on Title of Local NotificationdefaultIcon - - Icon you want to show by default with Local Notificationpublic static void schedule(int notificationId,
java.lang.String textContent,
long delay,
boolean isRepeat)
notificationId - - Unique int id of LocalNotificationtextContent - - Body text of your LocalNotificationdelay - - Delay time in millis after which your LocalNotification should be triggeredisRepeat - - boolean to indicate if LocalNotification should repeat after 'delay' interval or notpublic static void schedule(int notificationId,
java.lang.String channelId,
@DrawableRes
int smallIcon,
@DrawableRes
int largeIcon,
java.lang.String textTitle,
java.lang.String textContent,
long delay,
boolean isRepeat)
notificationId - - Unique int id of LocalNotificationchannelId - - Channel name on which you want to display your LocalNotificationsmallIcon - - Small monochrome png icon drawable you want to show with your LocalNotificationlargeIcon - - Colored icon image drawable you want to show with your LocalNotificationtextTitle - - Title text of your LocalNotificationtextContent - - Body text of your LocalNotificationdelay - - Delay time in millis after which your LocalNotification should be triggeredisRepeat - - boolean to indicate if LocalNotification should repeat after 'delay' interval or notpublic static void getAll(LocalNotificationHandler callback)
LocalNotifications which
are scheduled and going to trigger in future incallback - - object of interface LocalNotificationHandlerpublic static java.util.List<LocalNotification> getAllSync()
LocalNotifications which
are scheduled and going to trigger in future inpublic static void cancel(int notificationId)
notificationId - of LocalNotificationpublic static void cancel(LocalNotification notification)
notification - to cancelpublic static void cancelAll()
public static void isScheduled(int notificationId,
LocalNotificationStatusHandler callback)
notificationId - in acallback - object of interface LocalNotificationStatusHandlerpublic static boolean isScheduledSync(int notificationId)
notificationId - in a@Deprecated public static void destroy()