@openfin/notifications 2.13.0-alpha-4294
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +3 -0
- package/README.md +88 -0
- package/dist/client/index.d.ts +2253 -0
- package/dist/client/index.js +1 -0
- package/dist/template.json +25 -0
- package/package.json +26 -0
package/LICENSE.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<!-- README for NPM; the one for GitHub is in .github directory. -->
|
|
2
|
+
|
|
3
|
+
# HERE Notification Center
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The **HERE Notification Center** offers a consistent and streamlined way for developers to create, display, and manage desktop notifications. It also supports handling notification events seamlessly within a [web browser](https://www.npmjs.com/package/@openfin/web-notifications)
|
|
8
|
+
|
|
9
|
+
All notifications are displayed, categorized, and managed within a centralized Notification Center UI.
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- Create notifications.
|
|
14
|
+
- Clear and dismiss notifications.
|
|
15
|
+
- Attach handlers for when notifications are created, closed, and interacted with.
|
|
16
|
+
- Attach indicators and buttons with actions to notifications.
|
|
17
|
+
- Persist notifications in the Notification Center.
|
|
18
|
+
- Persist notification toasts.
|
|
19
|
+
- Create expiring and/or future notifications.
|
|
20
|
+
- Search notifications in the Notification Center.
|
|
21
|
+
- Create notifications with markdown, form, premade or custom templated notification content.
|
|
22
|
+
- Create grouping streams for notifications.
|
|
23
|
+
- Create pop-out frame windows for individiual notification senders and streams.
|
|
24
|
+
- Customize to specify the Notification Center and notification toast corners on screen.
|
|
25
|
+
- Customize Notification Center theme via Workspace Platforms.
|
|
26
|
+
- Set and cancel reminders.
|
|
27
|
+
|
|
28
|
+
## Getting Started
|
|
29
|
+
|
|
30
|
+
To connect your application to the Notification Center, install the HERE Notification Center Client API package.
|
|
31
|
+
|
|
32
|
+
### Import the Web Notification Center Client API
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install @here-io/notifications
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Desktop / HERE runtime environment
|
|
39
|
+
|
|
40
|
+
#### Usage
|
|
41
|
+
|
|
42
|
+
Connect to the Notification Center by importing the module.
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { connect, create } from '@here-io/notifications';
|
|
46
|
+
|
|
47
|
+
// connect to the notification center.
|
|
48
|
+
await register();
|
|
49
|
+
|
|
50
|
+
// call api methods...
|
|
51
|
+
await create(notificationOptions);
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Web / External connection
|
|
55
|
+
|
|
56
|
+
#### Set Up the Core-Web Fin Context
|
|
57
|
+
|
|
58
|
+
Before using the Notification Center, ensure your application is configured with a `fin` context from the `@openfin/core-web` package.
|
|
59
|
+
This context provides the necessary runtime connection and environment information.
|
|
60
|
+
|
|
61
|
+
For setup instructions, refer to the [@openfin/core-web](https://www.npmjs.com/package/@openfin/core-web) documentation.
|
|
62
|
+
|
|
63
|
+
#### Usage
|
|
64
|
+
|
|
65
|
+
Connect to the Notification Center by importing the module and providing the required options, including the `finContext`, `serviceId`, and the container element.
|
|
66
|
+
The `serviceId` must match the one used by the Notification Center service to ensure successful communication.
|
|
67
|
+
The `id`, `title`, and `icon` define the identity of the client application within the Notification Center.
|
|
68
|
+
The `id` should remain consistent across sessions to ensure notifications are correctly associated with the same client.
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import { connect, create } from '@here-io/notifications';
|
|
72
|
+
|
|
73
|
+
// ...initialize fin context.
|
|
74
|
+
|
|
75
|
+
// connect to the notification center.
|
|
76
|
+
await register({
|
|
77
|
+
externalProviderConfig: {
|
|
78
|
+
finContext: fin,
|
|
79
|
+
serviceId: 'notification-center-service-channel',
|
|
80
|
+
id: 'notification-provider-app-unique-id',
|
|
81
|
+
title: 'My Notification Provider App',
|
|
82
|
+
icon: 'https://example.com/logo.png'
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// call api methods...
|
|
87
|
+
await create(notificationOptions);
|
|
88
|
+
```
|