Methods related to notifications for the current user.
- Source:
Methods
static AddNotificationListener(onMessage) → Promise.<EventSource>
Add a listener to receive new notifications.
Returns: An EventSource instance listening for notifications. Use source.close() to close the listener.
Parameters:
Name | Type | Description |
---|---|---|
onMessage |
function |
Callback invoked when a new notification is received |
- Source:
static Notifications(limitoptional,tenantIdoptional,typesoptional,offsetIdoptional) → Promise.<Array.<Object>>
Retrieve notifications for the current user.
Returns: A list of notifications for the specified parameters
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
limit |
integer |
<optional> |
10 |
The maximum number of notifications to return |
tenantId |
string |
<optional> |
Filter notifications to only those related to the specified tenant |
|
types |
Array.<string> |
<optional> |
Filter notifications to only the specified types |
|
offsetId |
string |
<optional> |
Return notifications older than the specified ID |
- Source:
static PushNotification(tenantId,eventType,dataoptional,userAddressoptional)
Push a notification to a user
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tenantId |
string |
The tenant associated with this notification |
|
eventType |
string |
The type of the notification |
|
data |
Object | string |
<optional> |
Data associated with this notification |
userAddress |
string |
<optional> |
Address of the user to notify. If not specified, it will be sent to the current user. |
- Source: