OSCreateNotification class
The parameters & format to create push notifications is so different from receiving notifications that we represent a Create Notification object as an entirely different class
Constructors
-
OSCreateNotification({required List<
String> playerIds, required String? content, String? languageCode, String? heading, String? subtitle, bool? contentAvailable, bool? mutableContent, Map<String, dynamic> ? additionalData, String? url, Map<String, String> ? iosAttachments, String? bigPicture, List<OSActionButton> ? buttons, String? iosCategory, String? iosSound, String? androidSound, String? androidSmallIcon, String? androidLargeIcon, String? androidChannelId, int? iosBadgeCount, OSCreateNotificationBadgeType? iosBadgeType, String? collapseId, DateTime? sendAfter, OSCreateNotificationDelayOption? delayedOption, String? deliveryTimeOfDay}) -
OSCreateNotification.silentNotification({required List<
String> playerIds, Map<String, dynamic> ? additionalData, DateTime? sendAfter, OSCreateNotificationDelayOption? delayedOption, String? deliveryTimeOfDay})
Properties
-
additionalData
↔ Map<
String, dynamic> ? -
Additional data you wish to send with the notification
getter/setter pair
- androidChannelId ↔ String?
-
The Android Oreo Notification Category to send the notification under
getter/setter pair
- androidLargeIcon ↔ String?
-
A large icon (android only)
Can be a drawable resource name or a URL
getter/setter pair
- androidSmallIcon ↔ String?
-
A small icon (Android only)
Can be a drawable resource name or a URL
getter/setter pair
- androidSound ↔ String?
-
The sound to play (Android only)
getter/setter pair
- bigPicture ↔ String?
-
An image to use as the big picture (android only)
getter/setter pair
-
A list of buttons to attach to the notification
getter/setter pair
- collapseId ↔ String?
-
If multiple notifications have the same collapse ID, only the most
recent notification will be shown
getter/setter pair
- content ↔ String?
-
The notification's content (excluding title)
getter/setter pair
- contentAvailable ↔ bool?
-
Tells the app to launch in the background (iOS only)
getter/setter pair
- delayedOption ↔ OSCreateNotificationDelayOption?
-
You can use several options to send notifications at specific times
ie. you can send notifications to different user's at the same time
in each timezone with the 'timezone' delayedOption
getter/setter pair
- deliveryTimeOfDay ↔ String?
-
Used with delayedOption == timezone, lets you specify what time of day
each user should receive the notification, ie. "9:00 AM"
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- heading ↔ String?
-
The title/heading for the notification
getter/setter pair
-
iosAttachments
↔ Map<
String, String> ? -
Media (images, videos, etc.) for iOS
Maps a custom ID to a resource URL
in the format {'id' : 'https://.....'}
getter/setter pair
- iosBadgeCount ↔ int?
-
The actual badge count to either set to directly, or increment by
To decrement the user's badge count, send a negative value
getter/setter pair
- iosBadgeType ↔ OSCreateNotificationBadgeType?
-
can be 'Increase' or 'SetTo'
getter/setter pair
- iosCategory ↔ String?
-
The category identifier for iOS (controls various aspects
of the notification, for example, whether to launch a
Notification Content Extension) (iOS only)
getter/setter pair
- iosSound ↔ String?
-
The sound to play (iOS only)
getter/setter pair
- languageCode ↔ String?
-
The language code (ie. "en" for English) for this notification
defaults to "en" (English)
getter/setter pair
- mutableContent ↔ bool?
-
Tells the app to launch the Notification Service extension,
which can mutate your notification (ie. download attachments)
getter/setter pair
-
playerIds
↔ List<
String> -
An array of user ID's that should receive this notification
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sendAfter ↔ DateTime?
-
Allows you to send a notification at a specific date
getter/setter pair
- subtitle ↔ String?
-
The subtitle for the notification (iOS 10+ only)
getter/setter pair
- url ↔ String?
-
The URL to open when the user taps the notification
getter/setter pair
Methods
-
convertToJsonString(
Map< String, dynamic> ? object) → String -
inherited
-
jsonRepresentation(
) → String -
mapRepresentation(
) → Map< String, dynamic> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited