OneSignalNotifications class
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- permission → bool
-
Whether this app has push notification permission.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addClickListener(
OnNotificationClickListener listener) → void - The notification click listener is called whenever the user opens a OneSignal push notification, or taps an action button on a notification.
-
addForegroundWillDisplayListener(
OnNotificationWillDisplayListener listener) → void -
addPermissionObserver(
OnNotificationPermissionChangeObserver observer) → void - The OSNotificationPermissionObserver.onNotificationPermissionDidChange method will be fired on the passed-in object when a notification permission setting changes. This happens when the user enables or disables notifications for your app from the system settings outside of your app.
-
canRequest(
) → Future< bool> - Whether attempting to request notification permission will show a prompt. Returns true if the device has not been prompted for push notification permission already.
-
clearAll(
) → Future< void> - Removes all OneSignal notifications.
-
displayNotification(
String notificationId) → void -
lifecycleInit(
) → Future< void> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onNotificationPermissionDidChange(
bool permission) → void -
permissionNative(
) → Future< OSNotificationPermission> - iOS only enum OSNotificationPermission { notDetermined, denied, authorized, provisional, // only available in iOS 12 ephemeral, // only available in iOS 14
-
preventDefault(
String notificationId) → void - The notification willDisplay listener is called whenever a notification arrives and the application is in foreground
-
registerForProvisionalAuthorization(
bool fallbackToSettings) → Future< bool> - Instead of having to prompt the user for permission to send them push notifications, your app can request provisional authorization.
-
removeClickListener(
OnNotificationClickListener listener) → void -
removeForegroundWillDisplayListener(
OnNotificationWillDisplayListener listener) → void -
removeGroupedNotifications(
String notificationGroup) → Future< void> - Removes a grouped notification.
-
removeNotification(
int notificationId) → Future< void> - Removes a single notification.
-
removePermissionObserver(
OnNotificationPermissionChangeObserver observer) → void -
requestPermission(
bool fallbackToSettings) → Future< bool> - Prompt the user for permission to receive push notifications. This will display the native system prompt to request push notification permission.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited