SupaNotificationService class final

Properties

hashCode int
The hash code for this object.
no setterinherited
isSubscribed bool
true if the user is currently opted in.
no setter
playerId String?
OneSignal subscription ID for this device.
no setter
pushToken String?
Raw FCM / APNs push token.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<SupaNotification>
Stream of SupaNotification emitted on:
no setter

Methods

dispose() → void
Closes the stream controller. Call when the service is no longer needed.
hasPermission() Future<bool>
Returns true if the user has granted notification permission.
init({required NotificationOptions options}) Future<void>
Initialises OneSignal and sets up all listeners.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
optIn() → void
Opts the user in to push notifications.
optOut() → void
Opts the user out of push notifications.
removeExternalUserId() → void
Unlinks the external user ID.
removeTag(String key) → void
Removes a single tag by key.
removeTags(List<String> keys) → void
Removes multiple tags by their keys.
requestPermission() Future<bool>
Prompts the user for notification permission.
reset() → void
Logs out the current user and resets initialisation state. Call on user logout so the next init re-attaches a fresh user.
sendTags(Map<String, dynamic> tags) → void
Adds or updates user tags used for segmentation.
setExternalUserId(String userId) → void
Links this device to an external user ID (e.g. your backend user ID).
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance SupaNotificationService
Singleton instance.
final