capacitor-plugin-silent-notifications 0.9.1 → 0.9.2
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/README.md +7 -14
- package/dist/docs.json +3 -27
- package/dist/esm/definitions.d.ts +1 -1
- package/dist/esm/definitions.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@ Allows a Capacitor application to handle iOS remote/silent push notifications.
|
|
|
7
7
|
- Your app must be setup to receive push notifications (you need the device token)
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
|
+
[npm link](https://www.npmjs.com/package/capacitor-plugin-silent-notifications)
|
|
10
11
|
|
|
11
12
|
```bash
|
|
12
13
|
npm install capacitor-plugin-silent-notifications
|
|
@@ -52,7 +53,7 @@ import { CapacitorSilentNotifications } from 'capacitor-plugin-silent-notificati
|
|
|
52
53
|
CapacitorSilentNotifications.addListener('silentNotificationReceived', async (payload) => {
|
|
53
54
|
// do something with the notification payload here
|
|
54
55
|
console.log('silentNotificationReceived', payload);
|
|
55
|
-
}
|
|
56
|
+
});
|
|
56
57
|
```
|
|
57
58
|
|
|
58
59
|
## API
|
|
@@ -71,16 +72,16 @@ CapacitorSilentNotifications.addListener('silentNotificationReceived', async (pa
|
|
|
71
72
|
### addListener('silentNotificationReceived', ...)
|
|
72
73
|
|
|
73
74
|
```typescript
|
|
74
|
-
addListener(eventName: 'silentNotificationReceived', listenerFunc: (
|
|
75
|
+
addListener(eventName: 'silentNotificationReceived', listenerFunc: (payload: any) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
|
|
75
76
|
```
|
|
76
77
|
|
|
77
78
|
Listens to events associated with Silent Notifications
|
|
78
79
|
and notifies the listenerFunc if a background notification has been received.
|
|
79
80
|
|
|
80
|
-
| Param | Type
|
|
81
|
-
| ------------------ |
|
|
82
|
-
| **`eventName`** | <code>'silentNotificationReceived'</code>
|
|
83
|
-
| **`listenerFunc`** | <code>(
|
|
81
|
+
| Param | Type | Description |
|
|
82
|
+
| ------------------ | ----------------------------------------- | ----------------------------------------------- |
|
|
83
|
+
| **`eventName`** | <code>'silentNotificationReceived'</code> | Name of the event |
|
|
84
|
+
| **`listenerFunc`** | <code>(payload: any) => void</code> | Function to execute when listener gets notified |
|
|
84
85
|
|
|
85
86
|
**Returns:** <code>Promise<<a href="#pluginlistenerhandle">PluginListenerHandle</a>> & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
|
|
86
87
|
|
|
@@ -111,12 +112,4 @@ Remove all listeners for this plugin.
|
|
|
111
112
|
| ------------ | ----------------------------------------- |
|
|
112
113
|
| **`remove`** | <code>() => Promise<void></code> |
|
|
113
114
|
|
|
114
|
-
|
|
115
|
-
#### Options
|
|
116
|
-
|
|
117
|
-
| Prop | Type | Description |
|
|
118
|
-
| -------------- | ---------------- | --------------------------------------------------------------------------------------- |
|
|
119
|
-
| **`userInfo`** | <code>any</code> | Provide a key-value object that contains information sent with the remote notification. |
|
|
120
|
-
| **`object`** | <code>any</code> | Return the object sent with the data |
|
|
121
|
-
|
|
122
115
|
</docgen-api>
|
package/dist/docs.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"methods": [
|
|
8
8
|
{
|
|
9
9
|
"name": "addListener",
|
|
10
|
-
"signature": "(eventName: 'silentNotificationReceived', listenerFunc: (
|
|
10
|
+
"signature": "(eventName: 'silentNotificationReceived', listenerFunc: (payload: any) => void) => Promise<PluginListenerHandle> & PluginListenerHandle",
|
|
11
11
|
"parameters": [
|
|
12
12
|
{
|
|
13
13
|
"name": "eventName",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
{
|
|
18
18
|
"name": "listenerFunc",
|
|
19
19
|
"docs": "Function to execute when listener gets notified",
|
|
20
|
-
"type": "(
|
|
20
|
+
"type": "(payload: any) => void"
|
|
21
21
|
}
|
|
22
22
|
],
|
|
23
23
|
"returns": "Promise<PluginListenerHandle> & PluginListenerHandle",
|
|
@@ -37,8 +37,7 @@
|
|
|
37
37
|
],
|
|
38
38
|
"docs": "Listens to events associated with Silent Notifications\nand notifies the listenerFunc if a background notification has been received.",
|
|
39
39
|
"complexTypes": [
|
|
40
|
-
"PluginListenerHandle"
|
|
41
|
-
"Options"
|
|
40
|
+
"PluginListenerHandle"
|
|
42
41
|
],
|
|
43
42
|
"slug": "addlistenersilentnotificationreceived"
|
|
44
43
|
},
|
|
@@ -76,29 +75,6 @@
|
|
|
76
75
|
"type": "() => Promise<void>"
|
|
77
76
|
}
|
|
78
77
|
]
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"name": "Options",
|
|
82
|
-
"slug": "options",
|
|
83
|
-
"docs": "",
|
|
84
|
-
"tags": [],
|
|
85
|
-
"methods": [],
|
|
86
|
-
"properties": [
|
|
87
|
-
{
|
|
88
|
-
"name": "userInfo",
|
|
89
|
-
"tags": [],
|
|
90
|
-
"docs": "Provide a key-value object that contains information sent with the remote notification.",
|
|
91
|
-
"complexTypes": [],
|
|
92
|
-
"type": "any"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"name": "object",
|
|
96
|
-
"tags": [],
|
|
97
|
-
"docs": "Return the object sent with the data",
|
|
98
|
-
"complexTypes": [],
|
|
99
|
-
"type": "any"
|
|
100
|
-
}
|
|
101
|
-
]
|
|
102
78
|
}
|
|
103
79
|
],
|
|
104
80
|
"enums": [],
|
|
@@ -9,7 +9,7 @@ export interface CapacitorSilentNotificationsPlugin {
|
|
|
9
9
|
* @param eventName Name of the event
|
|
10
10
|
* @param listenerFunc Function to execute when listener gets notified
|
|
11
11
|
*/
|
|
12
|
-
addListener(eventName: 'silentNotificationReceived', listenerFunc: (
|
|
12
|
+
addListener(eventName: 'silentNotificationReceived', listenerFunc: (payload: any) => void): Promise<PluginListenerHandle> & PluginListenerHandle;
|
|
13
13
|
/**
|
|
14
14
|
* Remove all listeners for this plugin.
|
|
15
15
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import { PluginListenerHandle } from \"@capacitor/core\";\n\nexport interface CapacitorSilentNotificationsPlugin {\n // echo(options: { value: string }): Promise<{ value: string }>;\n /**\n * Listens to events associated with Silent Notifications\n * and notifies the listenerFunc if a background notification has been received.\n *\n * @since 1.0.0\n *\n * @param eventName Name of the event\n * @param listenerFunc Function to execute when listener gets notified\n */\n addListener(\n eventName: 'silentNotificationReceived',\n listenerFunc: (
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import { PluginListenerHandle } from \"@capacitor/core\";\n\nexport interface CapacitorSilentNotificationsPlugin {\n // echo(options: { value: string }): Promise<{ value: string }>;\n /**\n * Listens to events associated with Silent Notifications\n * and notifies the listenerFunc if a background notification has been received.\n *\n * @since 1.0.0\n *\n * @param eventName Name of the event\n * @param listenerFunc Function to execute when listener gets notified\n */\n addListener(\n eventName: 'silentNotificationReceived',\n listenerFunc: (payload: any) => void,\n ): Promise<PluginListenerHandle> & PluginListenerHandle;\n\n /**\n * Remove all listeners for this plugin.\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n\n /**\n * Not currently in use.\n */\n // markCompleted(): Promise<any>;\n}\n\nexport interface Options {\n /**\n * Provide a key-value object that contains information sent with the remote notification.\n */\n userInfo?: any;\n\n /**\n * Return the object sent with the data\n */\n object?: any;\n}\n"]}
|
package/package.json
CHANGED