@capacitor/background-runner 1.0.1-dev-20230731T175405.0 → 1.0.1-dev-20230807T230144.0
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 +105 -13
- package/dist/docs-api.json +588 -0
- package/dist/esm/apis.d.ts +271 -6
- package/dist/esm/apis.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -168,19 +168,9 @@ Below is a list of the available Web APIs provided in Background Runner:
|
|
|
168
168
|
- Request object not yet supported
|
|
169
169
|
- Only `method`, `headers` and `body` supported in options object
|
|
170
170
|
|
|
171
|
-
In addition to the standard Web APIs, Background Runner also supports a number of custom APIs that expose relevant mobile device functionality
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
- `get(key: string): string`
|
|
175
|
-
- `set(key: string, value: string)`
|
|
176
|
-
- `remove(key: string)`
|
|
177
|
-
- CapacitorNotifications - basic support for sending local notifications.
|
|
178
|
-
- `schedule()`
|
|
179
|
-
- CapacitorDevice - provides information on the device, such as network connectivity and battery status.
|
|
180
|
-
- `getBatteryStatus()`
|
|
181
|
-
- `getNetworkStatus()`
|
|
182
|
-
- CapacitorGeolocation - provides access to the device location information
|
|
183
|
-
- `getCurrentPosition()`
|
|
171
|
+
In addition to the standard Web APIs, Background Runner also supports a number of [custom Capacitor APIs](#capacitor-api) custom APIs that expose relevant mobile device functionality
|
|
172
|
+
|
|
173
|
+
|
|
184
174
|
|
|
185
175
|
## Runner Lifetimes
|
|
186
176
|
|
|
@@ -313,3 +303,105 @@ Dispatches an event to the configured runner.
|
|
|
313
303
|
<code>'geolocation' | 'notifications'</code>
|
|
314
304
|
|
|
315
305
|
</docgen-api>
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
## Capacitor API
|
|
309
|
+
<capacitor-api-docs>
|
|
310
|
+
|
|
311
|
+
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
312
|
+
|
|
313
|
+
### Interfaces
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
#### CapacitorDevice
|
|
317
|
+
|
|
318
|
+
Get information on the device, such as network connectivity and battery status.
|
|
319
|
+
|
|
320
|
+
| Prop | Type | Description | Since |
|
|
321
|
+
| ---------------------- | ---------------------------------------------------------------- | ---------------------------------------------- | ----- |
|
|
322
|
+
| **`getBatteryStatus`** | <code>() => <a href="#batterystatus">BatteryStatus</a></code> | Get the current battery status for the device. | 1.0.0 |
|
|
323
|
+
| **`getNetworkStatus`** | <code>() => <a href="#networkstatus">NetworkStatus</a></code> | Get the current network status for the device. | 1.0.0 |
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
#### BatteryStatus
|
|
327
|
+
|
|
328
|
+
| Prop | Type |
|
|
329
|
+
| ------------------ | -------------------- |
|
|
330
|
+
| **`batteryLevel`** | <code>number</code> |
|
|
331
|
+
| **`isCharging`** | <code>boolean</code> |
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
#### NetworkStatus
|
|
335
|
+
|
|
336
|
+
| Prop | Type |
|
|
337
|
+
| -------------------- | -------------------- |
|
|
338
|
+
| **`connected`** | <code>boolean</code> |
|
|
339
|
+
| **`connectionType`** | <code>string</code> |
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
#### CapacitorKV
|
|
343
|
+
|
|
344
|
+
A simple string key / value store backed by UserDefaults on iOS and Shared Preferences on Android.
|
|
345
|
+
|
|
346
|
+
| Prop | Type | Description | Since |
|
|
347
|
+
| ------------ | ---------------------------------------------------- | -------------------------------------- | ----- |
|
|
348
|
+
| **`set`** | <code>(key: string, value: string) => void</code> | Set a string value with the given key. | 1.0.0 |
|
|
349
|
+
| **`get`** | <code>(key: string) => string</code> | Get a string value for the given key. | 1.0.0 |
|
|
350
|
+
| **`remove`** | <code>(key: string) => void</code> | Remove a value with the given key. | 1.0.0 |
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
#### CapacitorNotifications
|
|
354
|
+
|
|
355
|
+
Send basic local notifications.
|
|
356
|
+
|
|
357
|
+
| Prop | Type | Description | Since |
|
|
358
|
+
| -------------- | ------------------------------------- | ----------------------------- | ----- |
|
|
359
|
+
| **`schedule`** | <code>(options: {}) => void</code> | Schedule a local notification | 1.0.0 |
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
#### NotificationScheduleOptions
|
|
363
|
+
|
|
364
|
+
| Prop | Type | Description | Since |
|
|
365
|
+
| ---------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
|
|
366
|
+
| **`id`** | <code>number</code> | The notification identifier. On Android it's a 32-bit int. So the value should be between -2147483648 and 2147483647 inclusive. | 1.0.0 |
|
|
367
|
+
| **`title`** | <code>string</code> | The title of the notification. | 1.0.0 |
|
|
368
|
+
| **`body`** | <code>string</code> | The body of the notification, shown below the title. | 1.0.0 |
|
|
369
|
+
| **`scheduleAt`** | <code>Date</code> | Date to send this notification. | 1.0.0 |
|
|
370
|
+
| **`sound`** | <code>string</code> | Name of the audio file to play when this notification is displayed. Include the file extension with the filename. On iOS, the file should be in the app bundle. On Android, the file should be in res/raw folder. Recommended format is `.wav` because is supported by both iOS and Android. Only available for iOS and Android < 26. For Android 26+ use channelId of a channel configured with the desired sound. If the sound file is not found, (i.e. empty string or wrong name) the default system notification sound will be used. If not provided, it will produce the default sound on Android and no sound on iOS. | 1.0.0 |
|
|
371
|
+
| **`actionTypeId`** | <code>string</code> | Associate an action type with this notification. | 1.0.0 |
|
|
372
|
+
| **`threadIdentifier`** | <code>string</code> | Used to group multiple notifications. Sets `threadIdentifier` on the [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent). Only available for iOS. | 1.0.0 |
|
|
373
|
+
| **`summaryArgument`** | <code>string</code> | The string this notification adds to the category's summary format string. Sets `summaryArgument` on the [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent). Only available for iOS. | 1.0.0 |
|
|
374
|
+
| **`group`** | <code>string</code> | Used to group multiple notifications. Calls `setGroup()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android. | 1.0.0 |
|
|
375
|
+
| **`groupSummary`** | <code>string</code> | If true, this notification becomes the summary for a group of notifications. Calls `setGroupSummary()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android when using `group`. | 1.0.0 |
|
|
376
|
+
| **`extra`** | <code>any</code> | Set extra data to store within this notification. | 1.0.0 |
|
|
377
|
+
| **`ongoing`** | <code>boolean</code> | If true, the notification can't be swiped away. Calls `setOngoing()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android. | 1.0.0 |
|
|
378
|
+
| **`autoCancel`** | <code>boolean</code> | If true, the notification is canceled when the user clicks on it. Calls `setAutoCancel()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android. | 1.0.0 |
|
|
379
|
+
| **`largeBody`** | <code>string</code> | Sets a multiline text block for display in a big text notification style. | 1.0.0 |
|
|
380
|
+
| **`summaryText`** | <code>string</code> | Used to set the summary text detail in inbox and big text notification styles. Only available for Android. | 1.0.0 |
|
|
381
|
+
| **`smallIcon`** | <code>string</code> | Set a custom status bar icon. If set, this overrides the `smallIcon` option from Capacitor configuration. Icons should be placed in your app's `res/drawable` folder. The value for this option should be the drawable resource ID, which is the filename without an extension. Only available for Android. | 1.0.0 |
|
|
382
|
+
| **`largeIcon`** | <code>string</code> | Set a large icon for notifications. Icons should be placed in your app's `res/drawable` folder. The value for this option should be the drawable resource ID, which is the filename without an extension. Only available for Android. | 1.0.0 |
|
|
383
|
+
| **`channelId`** | <code>string</code> | Specifies the channel the notification should be delivered on. If channel with the given name does not exist then the notification will not fire. If not provided, it will use the default channel. Calls `setChannelId()` on [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder) with the provided value. Only available for Android 26+. | 1.0.0 |
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
#### CapacitorGeolocation
|
|
387
|
+
|
|
388
|
+
Get access to device location information.
|
|
389
|
+
|
|
390
|
+
| Prop | Type | Description | Since |
|
|
391
|
+
| ------------------------ | -------------------------------------------------------------------------------------- | ------------------------------------ | ----- |
|
|
392
|
+
| **`getCurrentLocation`** | <code>() => <a href="#getcurrentpositionresult">GetCurrentPositionResult</a></code> | Get the device's last known location | 1.0.0 |
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
#### GetCurrentPositionResult
|
|
396
|
+
|
|
397
|
+
| Prop | Type | Description | Since |
|
|
398
|
+
| ---------------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------- | ----- |
|
|
399
|
+
| **`latitude`** | <code>number</code> | Latitude in decimal degrees | 1.0.0 |
|
|
400
|
+
| **`longitude`** | <code>number</code> | longitude in decimal degrees | 1.0.0 |
|
|
401
|
+
| **`accuracy`** | <code>number</code> | Accuracy level of the latitude and longitude coordinates in meters | 1.0.0 |
|
|
402
|
+
| **`altitude`** | <code>number \| null</code> | The altitude the user is at (if available) | 1.0.0 |
|
|
403
|
+
| **`altitudeAccuracy`** | <code>number \| null</code> | Accuracy level of the altitude coordinate in meters, if available. Available on all iOS versions and on Android 8.0+. | 1.0.0 |
|
|
404
|
+
| **`speed`** | <code>number \| null</code> | The speed the user is traveling (if available) | 1.0.0 |
|
|
405
|
+
| **`heading`** | <code>number \| null</code> | The heading the user is facing (if available) | 1.0.0 |
|
|
406
|
+
|
|
407
|
+
</capacitor-api-docs>
|
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "CapacitorAPI",
|
|
4
|
+
"slug": "capacitorapi",
|
|
5
|
+
"docs": "",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"methods": [],
|
|
8
|
+
"properties": [
|
|
9
|
+
{
|
|
10
|
+
"name": "CapacitorDevice",
|
|
11
|
+
"tags": [],
|
|
12
|
+
"docs": "",
|
|
13
|
+
"complexTypes": [
|
|
14
|
+
"CapacitorDevice"
|
|
15
|
+
],
|
|
16
|
+
"type": "CapacitorDevice"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "CapacitorKV",
|
|
20
|
+
"tags": [],
|
|
21
|
+
"docs": "",
|
|
22
|
+
"complexTypes": [
|
|
23
|
+
"CapacitorKV"
|
|
24
|
+
],
|
|
25
|
+
"type": "CapacitorKV"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "CapacitorNotifications",
|
|
29
|
+
"tags": [],
|
|
30
|
+
"docs": "",
|
|
31
|
+
"complexTypes": [
|
|
32
|
+
"CapacitorNotifications"
|
|
33
|
+
],
|
|
34
|
+
"type": "CapacitorNotifications"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "CapacitorGeolocation",
|
|
38
|
+
"tags": [],
|
|
39
|
+
"docs": "",
|
|
40
|
+
"complexTypes": [
|
|
41
|
+
"CapacitorGeolocation"
|
|
42
|
+
],
|
|
43
|
+
"type": "CapacitorGeolocation"
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"interfaces": [
|
|
48
|
+
{
|
|
49
|
+
"name": "CapacitorDevice",
|
|
50
|
+
"slug": "capacitordevice",
|
|
51
|
+
"docs": "Get information on the device, such as network connectivity and battery status.",
|
|
52
|
+
"tags": [],
|
|
53
|
+
"methods": [],
|
|
54
|
+
"properties": [
|
|
55
|
+
{
|
|
56
|
+
"name": "getBatteryStatus",
|
|
57
|
+
"tags": [
|
|
58
|
+
{
|
|
59
|
+
"text": "1.0.0",
|
|
60
|
+
"name": "since"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"docs": "Get the current battery status for the device.",
|
|
64
|
+
"complexTypes": [
|
|
65
|
+
"BatteryStatus"
|
|
66
|
+
],
|
|
67
|
+
"type": "() => BatteryStatus"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "getNetworkStatus",
|
|
71
|
+
"tags": [
|
|
72
|
+
{
|
|
73
|
+
"text": "1.0.0",
|
|
74
|
+
"name": "since"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"docs": "Get the current network status for the device.",
|
|
78
|
+
"complexTypes": [
|
|
79
|
+
"NetworkStatus"
|
|
80
|
+
],
|
|
81
|
+
"type": "() => NetworkStatus"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "BatteryStatus",
|
|
87
|
+
"slug": "batterystatus",
|
|
88
|
+
"docs": "",
|
|
89
|
+
"tags": [],
|
|
90
|
+
"methods": [],
|
|
91
|
+
"properties": [
|
|
92
|
+
{
|
|
93
|
+
"name": "batteryLevel",
|
|
94
|
+
"tags": [],
|
|
95
|
+
"docs": "",
|
|
96
|
+
"complexTypes": [],
|
|
97
|
+
"type": "number"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"name": "isCharging",
|
|
101
|
+
"tags": [],
|
|
102
|
+
"docs": "",
|
|
103
|
+
"complexTypes": [],
|
|
104
|
+
"type": "boolean"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "NetworkStatus",
|
|
110
|
+
"slug": "networkstatus",
|
|
111
|
+
"docs": "",
|
|
112
|
+
"tags": [],
|
|
113
|
+
"methods": [],
|
|
114
|
+
"properties": [
|
|
115
|
+
{
|
|
116
|
+
"name": "connected",
|
|
117
|
+
"tags": [],
|
|
118
|
+
"docs": "",
|
|
119
|
+
"complexTypes": [],
|
|
120
|
+
"type": "boolean"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "connectionType",
|
|
124
|
+
"tags": [],
|
|
125
|
+
"docs": "",
|
|
126
|
+
"complexTypes": [],
|
|
127
|
+
"type": "string"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "CapacitorKV",
|
|
133
|
+
"slug": "capacitorkv",
|
|
134
|
+
"docs": "A simple string key / value store backed by UserDefaults on iOS and Shared Preferences on Android.",
|
|
135
|
+
"tags": [],
|
|
136
|
+
"methods": [],
|
|
137
|
+
"properties": [
|
|
138
|
+
{
|
|
139
|
+
"name": "set",
|
|
140
|
+
"tags": [
|
|
141
|
+
{
|
|
142
|
+
"text": "key",
|
|
143
|
+
"name": "param"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"text": "value",
|
|
147
|
+
"name": "param"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "returns"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"text": "1.0.0",
|
|
154
|
+
"name": "since"
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"docs": "Set a string value with the given key.",
|
|
158
|
+
"complexTypes": [],
|
|
159
|
+
"type": "(key: string, value: string) => void"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "get",
|
|
163
|
+
"tags": [
|
|
164
|
+
{
|
|
165
|
+
"text": "key",
|
|
166
|
+
"name": "param"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "returns"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"text": "1.0.0",
|
|
173
|
+
"name": "since"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"docs": "Get a string value for the given key.",
|
|
177
|
+
"complexTypes": [],
|
|
178
|
+
"type": "(key: string) => string"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "remove",
|
|
182
|
+
"tags": [
|
|
183
|
+
{
|
|
184
|
+
"text": "key",
|
|
185
|
+
"name": "param"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"name": "returns"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"text": "1.0.0",
|
|
192
|
+
"name": "since"
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"docs": "Remove a value with the given key.",
|
|
196
|
+
"complexTypes": [],
|
|
197
|
+
"type": "(key: string) => void"
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"name": "CapacitorNotifications",
|
|
203
|
+
"slug": "capacitornotifications",
|
|
204
|
+
"docs": "Send basic local notifications.",
|
|
205
|
+
"tags": [],
|
|
206
|
+
"methods": [],
|
|
207
|
+
"properties": [
|
|
208
|
+
{
|
|
209
|
+
"name": "schedule",
|
|
210
|
+
"tags": [
|
|
211
|
+
{
|
|
212
|
+
"text": "`CapacitorNotifications.schedule()`",
|
|
213
|
+
"name": "example"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"text": "options",
|
|
217
|
+
"name": "param"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"text": "void",
|
|
221
|
+
"name": "returns"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"text": "1.0.0",
|
|
225
|
+
"name": "since"
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"docs": "Schedule a local notification",
|
|
229
|
+
"complexTypes": [
|
|
230
|
+
"NotificationScheduleOptions"
|
|
231
|
+
],
|
|
232
|
+
"type": "(options: {}) => void"
|
|
233
|
+
}
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"name": "NotificationScheduleOptions",
|
|
238
|
+
"slug": "notificationscheduleoptions",
|
|
239
|
+
"docs": "",
|
|
240
|
+
"tags": [],
|
|
241
|
+
"methods": [],
|
|
242
|
+
"properties": [
|
|
243
|
+
{
|
|
244
|
+
"name": "id",
|
|
245
|
+
"tags": [
|
|
246
|
+
{
|
|
247
|
+
"text": "1.0.0",
|
|
248
|
+
"name": "since"
|
|
249
|
+
}
|
|
250
|
+
],
|
|
251
|
+
"docs": "The notification identifier.\nOn Android it's a 32-bit int.\nSo the value should be between -2147483648 and 2147483647 inclusive.",
|
|
252
|
+
"complexTypes": [],
|
|
253
|
+
"type": "number"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"name": "title",
|
|
257
|
+
"tags": [
|
|
258
|
+
{
|
|
259
|
+
"text": "1.0.0",
|
|
260
|
+
"name": "since"
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
"docs": "The title of the notification.",
|
|
264
|
+
"complexTypes": [],
|
|
265
|
+
"type": "string"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "body",
|
|
269
|
+
"tags": [
|
|
270
|
+
{
|
|
271
|
+
"text": "1.0.0",
|
|
272
|
+
"name": "since"
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
"docs": "The body of the notification, shown below the title.",
|
|
276
|
+
"complexTypes": [],
|
|
277
|
+
"type": "string"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "scheduleAt",
|
|
281
|
+
"tags": [
|
|
282
|
+
{
|
|
283
|
+
"text": "1.0.0",
|
|
284
|
+
"name": "since"
|
|
285
|
+
}
|
|
286
|
+
],
|
|
287
|
+
"docs": "Date to send this notification.",
|
|
288
|
+
"complexTypes": [
|
|
289
|
+
"Date"
|
|
290
|
+
],
|
|
291
|
+
"type": "Date"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"name": "sound",
|
|
295
|
+
"tags": [
|
|
296
|
+
{
|
|
297
|
+
"text": "1.0.0",
|
|
298
|
+
"name": "since"
|
|
299
|
+
}
|
|
300
|
+
],
|
|
301
|
+
"docs": "Name of the audio file to play when this notification is displayed.\n\nInclude the file extension with the filename.\n\nOn iOS, the file should be in the app bundle.\nOn Android, the file should be in res/raw folder.\n\nRecommended format is `.wav` because is supported by both iOS and Android.\n\nOnly available for iOS and Android < 26.\nFor Android 26+ use channelId of a channel configured with the desired sound.\n\nIf the sound file is not found, (i.e. empty string or wrong name)\nthe default system notification sound will be used.\nIf not provided, it will produce the default sound on Android and no sound on iOS.",
|
|
302
|
+
"complexTypes": [],
|
|
303
|
+
"type": "string | undefined"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"name": "actionTypeId",
|
|
307
|
+
"tags": [
|
|
308
|
+
{
|
|
309
|
+
"text": "1.0.0",
|
|
310
|
+
"name": "since"
|
|
311
|
+
}
|
|
312
|
+
],
|
|
313
|
+
"docs": "Associate an action type with this notification.",
|
|
314
|
+
"complexTypes": [],
|
|
315
|
+
"type": "string | undefined"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"name": "threadIdentifier",
|
|
319
|
+
"tags": [
|
|
320
|
+
{
|
|
321
|
+
"text": "1.0.0",
|
|
322
|
+
"name": "since"
|
|
323
|
+
}
|
|
324
|
+
],
|
|
325
|
+
"docs": "Used to group multiple notifications.\n\nSets `threadIdentifier` on the\n[`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).\n\nOnly available for iOS.",
|
|
326
|
+
"complexTypes": [],
|
|
327
|
+
"type": "string | undefined"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"name": "summaryArgument",
|
|
331
|
+
"tags": [
|
|
332
|
+
{
|
|
333
|
+
"text": "1.0.0",
|
|
334
|
+
"name": "since"
|
|
335
|
+
}
|
|
336
|
+
],
|
|
337
|
+
"docs": "The string this notification adds to the category's summary format string.\n\nSets `summaryArgument` on the\n[`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).\n\nOnly available for iOS.",
|
|
338
|
+
"complexTypes": [],
|
|
339
|
+
"type": "string | undefined"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"name": "group",
|
|
343
|
+
"tags": [
|
|
344
|
+
{
|
|
345
|
+
"text": "1.0.0",
|
|
346
|
+
"name": "since"
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
"docs": "Used to group multiple notifications.\n\nCalls `setGroup()` on\n[`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\nwith the provided value.\n\nOnly available for Android.",
|
|
350
|
+
"complexTypes": [],
|
|
351
|
+
"type": "string | undefined"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"name": "groupSummary",
|
|
355
|
+
"tags": [
|
|
356
|
+
{
|
|
357
|
+
"text": "1.0.0",
|
|
358
|
+
"name": "since"
|
|
359
|
+
}
|
|
360
|
+
],
|
|
361
|
+
"docs": "If true, this notification becomes the summary for a group of\nnotifications.\n\nCalls `setGroupSummary()` on\n[`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\nwith the provided value.\n\nOnly available for Android when using `group`.",
|
|
362
|
+
"complexTypes": [],
|
|
363
|
+
"type": "string | undefined"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"name": "extra",
|
|
367
|
+
"tags": [
|
|
368
|
+
{
|
|
369
|
+
"text": "1.0.0",
|
|
370
|
+
"name": "since"
|
|
371
|
+
}
|
|
372
|
+
],
|
|
373
|
+
"docs": "Set extra data to store within this notification.",
|
|
374
|
+
"complexTypes": [],
|
|
375
|
+
"type": "any"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"name": "ongoing",
|
|
379
|
+
"tags": [
|
|
380
|
+
{
|
|
381
|
+
"text": "1.0.0",
|
|
382
|
+
"name": "since"
|
|
383
|
+
}
|
|
384
|
+
],
|
|
385
|
+
"docs": "If true, the notification can't be swiped away.\n\nCalls `setOngoing()` on\n[`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\nwith the provided value.\n\nOnly available for Android.",
|
|
386
|
+
"complexTypes": [],
|
|
387
|
+
"type": "boolean | undefined"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"name": "autoCancel",
|
|
391
|
+
"tags": [
|
|
392
|
+
{
|
|
393
|
+
"text": "1.0.0",
|
|
394
|
+
"name": "since"
|
|
395
|
+
}
|
|
396
|
+
],
|
|
397
|
+
"docs": "If true, the notification is canceled when the user clicks on it.\n\nCalls `setAutoCancel()` on\n[`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\nwith the provided value.\n\nOnly available for Android.",
|
|
398
|
+
"complexTypes": [],
|
|
399
|
+
"type": "boolean | undefined"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "largeBody",
|
|
403
|
+
"tags": [
|
|
404
|
+
{
|
|
405
|
+
"text": "1.0.0",
|
|
406
|
+
"name": "since"
|
|
407
|
+
}
|
|
408
|
+
],
|
|
409
|
+
"docs": "Sets a multiline text block for display in a big text notification style.",
|
|
410
|
+
"complexTypes": [],
|
|
411
|
+
"type": "string | undefined"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"name": "summaryText",
|
|
415
|
+
"tags": [
|
|
416
|
+
{
|
|
417
|
+
"text": "1.0.0",
|
|
418
|
+
"name": "since"
|
|
419
|
+
}
|
|
420
|
+
],
|
|
421
|
+
"docs": "Used to set the summary text detail in inbox and big text notification styles.\n\nOnly available for Android.",
|
|
422
|
+
"complexTypes": [],
|
|
423
|
+
"type": "string | undefined"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"name": "smallIcon",
|
|
427
|
+
"tags": [
|
|
428
|
+
{
|
|
429
|
+
"text": "1.0.0",
|
|
430
|
+
"name": "since"
|
|
431
|
+
}
|
|
432
|
+
],
|
|
433
|
+
"docs": "Set a custom status bar icon.\n\nIf set, this overrides the `smallIcon` option from Capacitor\nconfiguration.\n\nIcons should be placed in your app's `res/drawable` folder. The value for\nthis option should be the drawable resource ID, which is the filename\nwithout an extension.\n\nOnly available for Android.",
|
|
434
|
+
"complexTypes": [],
|
|
435
|
+
"type": "string | undefined"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"name": "largeIcon",
|
|
439
|
+
"tags": [
|
|
440
|
+
{
|
|
441
|
+
"text": "1.0.0",
|
|
442
|
+
"name": "since"
|
|
443
|
+
}
|
|
444
|
+
],
|
|
445
|
+
"docs": "Set a large icon for notifications.\n\nIcons should be placed in your app's `res/drawable` folder. The value for\nthis option should be the drawable resource ID, which is the filename\nwithout an extension.\n\nOnly available for Android.",
|
|
446
|
+
"complexTypes": [],
|
|
447
|
+
"type": "string | undefined"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"name": "channelId",
|
|
451
|
+
"tags": [
|
|
452
|
+
{
|
|
453
|
+
"text": "1.0.0",
|
|
454
|
+
"name": "since"
|
|
455
|
+
}
|
|
456
|
+
],
|
|
457
|
+
"docs": "Specifies the channel the notification should be delivered on.\n\nIf channel with the given name does not exist then the notification will\nnot fire. If not provided, it will use the default channel.\n\nCalls `setChannelId()` on\n[`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\nwith the provided value.\n\nOnly available for Android 26+.",
|
|
458
|
+
"complexTypes": [],
|
|
459
|
+
"type": "string | undefined"
|
|
460
|
+
}
|
|
461
|
+
]
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"name": "CapacitorGeolocation",
|
|
465
|
+
"slug": "capacitorgeolocation",
|
|
466
|
+
"docs": "Get access to device location information.",
|
|
467
|
+
"tags": [
|
|
468
|
+
{
|
|
469
|
+
"text": "1.0.0",
|
|
470
|
+
"name": "since"
|
|
471
|
+
}
|
|
472
|
+
],
|
|
473
|
+
"methods": [],
|
|
474
|
+
"properties": [
|
|
475
|
+
{
|
|
476
|
+
"name": "getCurrentLocation",
|
|
477
|
+
"tags": [
|
|
478
|
+
{
|
|
479
|
+
"text": "1.0.0",
|
|
480
|
+
"name": "since"
|
|
481
|
+
}
|
|
482
|
+
],
|
|
483
|
+
"docs": "Get the device's last known location",
|
|
484
|
+
"complexTypes": [
|
|
485
|
+
"GetCurrentPositionResult"
|
|
486
|
+
],
|
|
487
|
+
"type": "() => GetCurrentPositionResult"
|
|
488
|
+
}
|
|
489
|
+
]
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
"name": "GetCurrentPositionResult",
|
|
493
|
+
"slug": "getcurrentpositionresult",
|
|
494
|
+
"docs": "",
|
|
495
|
+
"tags": [],
|
|
496
|
+
"methods": [],
|
|
497
|
+
"properties": [
|
|
498
|
+
{
|
|
499
|
+
"name": "latitude",
|
|
500
|
+
"tags": [
|
|
501
|
+
{
|
|
502
|
+
"text": "1.0.0",
|
|
503
|
+
"name": "since"
|
|
504
|
+
}
|
|
505
|
+
],
|
|
506
|
+
"docs": "Latitude in decimal degrees",
|
|
507
|
+
"complexTypes": [],
|
|
508
|
+
"type": "number"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"name": "longitude",
|
|
512
|
+
"tags": [
|
|
513
|
+
{
|
|
514
|
+
"text": "1.0.0",
|
|
515
|
+
"name": "since"
|
|
516
|
+
}
|
|
517
|
+
],
|
|
518
|
+
"docs": "longitude in decimal degrees",
|
|
519
|
+
"complexTypes": [],
|
|
520
|
+
"type": "number"
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
"name": "accuracy",
|
|
524
|
+
"tags": [
|
|
525
|
+
{
|
|
526
|
+
"text": "1.0.0",
|
|
527
|
+
"name": "since"
|
|
528
|
+
}
|
|
529
|
+
],
|
|
530
|
+
"docs": "Accuracy level of the latitude and longitude coordinates in meters",
|
|
531
|
+
"complexTypes": [],
|
|
532
|
+
"type": "number"
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"name": "altitude",
|
|
536
|
+
"tags": [
|
|
537
|
+
{
|
|
538
|
+
"text": "1.0.0",
|
|
539
|
+
"name": "since"
|
|
540
|
+
}
|
|
541
|
+
],
|
|
542
|
+
"docs": "The altitude the user is at (if available)",
|
|
543
|
+
"complexTypes": [],
|
|
544
|
+
"type": "number | null"
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
"name": "altitudeAccuracy",
|
|
548
|
+
"tags": [
|
|
549
|
+
{
|
|
550
|
+
"text": "1.0.0",
|
|
551
|
+
"name": "since"
|
|
552
|
+
}
|
|
553
|
+
],
|
|
554
|
+
"docs": "Accuracy level of the altitude coordinate in meters, if available.\n\nAvailable on all iOS versions and on Android 8.0+.",
|
|
555
|
+
"complexTypes": [],
|
|
556
|
+
"type": "number | null | undefined"
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
"name": "speed",
|
|
560
|
+
"tags": [
|
|
561
|
+
{
|
|
562
|
+
"text": "1.0.0",
|
|
563
|
+
"name": "since"
|
|
564
|
+
}
|
|
565
|
+
],
|
|
566
|
+
"docs": "The speed the user is traveling (if available)",
|
|
567
|
+
"complexTypes": [],
|
|
568
|
+
"type": "number | null"
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
"name": "heading",
|
|
572
|
+
"tags": [
|
|
573
|
+
{
|
|
574
|
+
"text": "1.0.0",
|
|
575
|
+
"name": "since"
|
|
576
|
+
}
|
|
577
|
+
],
|
|
578
|
+
"docs": "The heading the user is facing (if available)",
|
|
579
|
+
"complexTypes": [],
|
|
580
|
+
"type": "number | null"
|
|
581
|
+
}
|
|
582
|
+
]
|
|
583
|
+
}
|
|
584
|
+
],
|
|
585
|
+
"enums": [],
|
|
586
|
+
"typeAliases": [],
|
|
587
|
+
"pluginConfigs": []
|
|
588
|
+
}
|
package/dist/esm/apis.d.ts
CHANGED
|
@@ -1,11 +1,48 @@
|
|
|
1
1
|
export interface GetCurrentPositionResult {
|
|
2
|
+
/**
|
|
3
|
+
* Latitude in decimal degrees
|
|
4
|
+
*
|
|
5
|
+
* @since 1.0.0
|
|
6
|
+
*/
|
|
2
7
|
latitude: number;
|
|
8
|
+
/**
|
|
9
|
+
* longitude in decimal degrees
|
|
10
|
+
*
|
|
11
|
+
* @since 1.0.0
|
|
12
|
+
*/
|
|
3
13
|
longitude: number;
|
|
14
|
+
/**
|
|
15
|
+
* Accuracy level of the latitude and longitude coordinates in meters
|
|
16
|
+
*
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
*/
|
|
4
19
|
accuracy: number;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The altitude the user is at (if available)
|
|
22
|
+
*
|
|
23
|
+
* @since 1.0.0
|
|
24
|
+
*/
|
|
25
|
+
altitude: number | null;
|
|
26
|
+
/**
|
|
27
|
+
* Accuracy level of the altitude coordinate in meters, if available.
|
|
28
|
+
*
|
|
29
|
+
* Available on all iOS versions and on Android 8.0+.
|
|
30
|
+
*
|
|
31
|
+
* @since 1.0.0
|
|
32
|
+
*/
|
|
33
|
+
altitudeAccuracy?: number | null | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The speed the user is traveling (if available)
|
|
36
|
+
*
|
|
37
|
+
* @since 1.0.0
|
|
38
|
+
*/
|
|
39
|
+
speed: number | null;
|
|
40
|
+
/**
|
|
41
|
+
* The heading the user is facing (if available)
|
|
42
|
+
*
|
|
43
|
+
* @since 1.0.0
|
|
44
|
+
*/
|
|
45
|
+
heading: number | null;
|
|
9
46
|
}
|
|
10
47
|
export interface BatteryStatus {
|
|
11
48
|
batteryLevel: number;
|
|
@@ -16,37 +53,265 @@ export interface NetworkStatus {
|
|
|
16
53
|
connectionType: string;
|
|
17
54
|
}
|
|
18
55
|
export interface NotificationScheduleOptions {
|
|
56
|
+
/**
|
|
57
|
+
* The notification identifier.
|
|
58
|
+
* On Android it's a 32-bit int.
|
|
59
|
+
* So the value should be between -2147483648 and 2147483647 inclusive.
|
|
60
|
+
*
|
|
61
|
+
* @since 1.0.0
|
|
62
|
+
*/
|
|
19
63
|
id: number;
|
|
64
|
+
/**
|
|
65
|
+
* The title of the notification.
|
|
66
|
+
*
|
|
67
|
+
* @since 1.0.0
|
|
68
|
+
*/
|
|
20
69
|
title: string;
|
|
70
|
+
/**
|
|
71
|
+
* The body of the notification, shown below the title.
|
|
72
|
+
*
|
|
73
|
+
* @since 1.0.0
|
|
74
|
+
*/
|
|
21
75
|
body: string;
|
|
76
|
+
/**
|
|
77
|
+
* Date to send this notification.
|
|
78
|
+
*
|
|
79
|
+
* @since 1.0.0
|
|
80
|
+
*/
|
|
22
81
|
scheduleAt: Date;
|
|
82
|
+
/**
|
|
83
|
+
* Name of the audio file to play when this notification is displayed.
|
|
84
|
+
*
|
|
85
|
+
* Include the file extension with the filename.
|
|
86
|
+
*
|
|
87
|
+
* On iOS, the file should be in the app bundle.
|
|
88
|
+
* On Android, the file should be in res/raw folder.
|
|
89
|
+
*
|
|
90
|
+
* Recommended format is `.wav` because is supported by both iOS and Android.
|
|
91
|
+
*
|
|
92
|
+
* Only available for iOS and Android < 26.
|
|
93
|
+
* For Android 26+ use channelId of a channel configured with the desired sound.
|
|
94
|
+
*
|
|
95
|
+
* If the sound file is not found, (i.e. empty string or wrong name)
|
|
96
|
+
* the default system notification sound will be used.
|
|
97
|
+
* If not provided, it will produce the default sound on Android and no sound on iOS.
|
|
98
|
+
*
|
|
99
|
+
* @since 1.0.0
|
|
100
|
+
*/
|
|
23
101
|
sound?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Associate an action type with this notification.
|
|
104
|
+
*
|
|
105
|
+
* @since 1.0.0
|
|
106
|
+
*/
|
|
24
107
|
actionTypeId?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Used to group multiple notifications.
|
|
110
|
+
*
|
|
111
|
+
* Sets `threadIdentifier` on the
|
|
112
|
+
* [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).
|
|
113
|
+
*
|
|
114
|
+
* Only available for iOS.
|
|
115
|
+
*
|
|
116
|
+
* @since 1.0.0
|
|
117
|
+
*/
|
|
25
118
|
threadIdentifier?: string;
|
|
119
|
+
/**
|
|
120
|
+
* The string this notification adds to the category's summary format string.
|
|
121
|
+
*
|
|
122
|
+
* Sets `summaryArgument` on the
|
|
123
|
+
* [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).
|
|
124
|
+
*
|
|
125
|
+
* Only available for iOS.
|
|
126
|
+
*
|
|
127
|
+
* @since 1.0.0
|
|
128
|
+
*/
|
|
26
129
|
summaryArgument?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Used to group multiple notifications.
|
|
132
|
+
*
|
|
133
|
+
* Calls `setGroup()` on
|
|
134
|
+
* [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)
|
|
135
|
+
* with the provided value.
|
|
136
|
+
*
|
|
137
|
+
* Only available for Android.
|
|
138
|
+
*
|
|
139
|
+
* @since 1.0.0
|
|
140
|
+
*/
|
|
141
|
+
group?: string;
|
|
142
|
+
/**
|
|
143
|
+
* If true, this notification becomes the summary for a group of
|
|
144
|
+
* notifications.
|
|
145
|
+
*
|
|
146
|
+
* Calls `setGroupSummary()` on
|
|
147
|
+
* [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)
|
|
148
|
+
* with the provided value.
|
|
149
|
+
*
|
|
150
|
+
* Only available for Android when using `group`.
|
|
151
|
+
*
|
|
152
|
+
* @since 1.0.0
|
|
153
|
+
*/
|
|
27
154
|
groupSummary?: string;
|
|
28
|
-
|
|
155
|
+
/**
|
|
156
|
+
* Set extra data to store within this notification.
|
|
157
|
+
*
|
|
158
|
+
* @since 1.0.0
|
|
159
|
+
*/
|
|
160
|
+
extra?: any;
|
|
161
|
+
/**
|
|
162
|
+
* If true, the notification can't be swiped away.
|
|
163
|
+
*
|
|
164
|
+
* Calls `setOngoing()` on
|
|
165
|
+
* [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)
|
|
166
|
+
* with the provided value.
|
|
167
|
+
*
|
|
168
|
+
* Only available for Android.
|
|
169
|
+
*
|
|
170
|
+
* @since 1.0.0
|
|
171
|
+
*/
|
|
29
172
|
ongoing?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* If true, the notification is canceled when the user clicks on it.
|
|
175
|
+
*
|
|
176
|
+
* Calls `setAutoCancel()` on
|
|
177
|
+
* [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)
|
|
178
|
+
* with the provided value.
|
|
179
|
+
*
|
|
180
|
+
* Only available for Android.
|
|
181
|
+
*
|
|
182
|
+
* @since 1.0.0
|
|
183
|
+
*/
|
|
30
184
|
autoCancel?: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Sets a multiline text block for display in a big text notification style.
|
|
187
|
+
*
|
|
188
|
+
* @since 1.0.0
|
|
189
|
+
*/
|
|
31
190
|
largeBody?: string;
|
|
191
|
+
/**
|
|
192
|
+
* Used to set the summary text detail in inbox and big text notification styles.
|
|
193
|
+
*
|
|
194
|
+
* Only available for Android.
|
|
195
|
+
*
|
|
196
|
+
* @since 1.0.0
|
|
197
|
+
*/
|
|
32
198
|
summaryText?: string;
|
|
199
|
+
/**
|
|
200
|
+
* Set a custom status bar icon.
|
|
201
|
+
*
|
|
202
|
+
* If set, this overrides the `smallIcon` option from Capacitor
|
|
203
|
+
* configuration.
|
|
204
|
+
*
|
|
205
|
+
* Icons should be placed in your app's `res/drawable` folder. The value for
|
|
206
|
+
* this option should be the drawable resource ID, which is the filename
|
|
207
|
+
* without an extension.
|
|
208
|
+
*
|
|
209
|
+
* Only available for Android.
|
|
210
|
+
*
|
|
211
|
+
* @since 1.0.0
|
|
212
|
+
*/
|
|
33
213
|
smallIcon?: string;
|
|
214
|
+
/**
|
|
215
|
+
* Set a large icon for notifications.
|
|
216
|
+
*
|
|
217
|
+
* Icons should be placed in your app's `res/drawable` folder. The value for
|
|
218
|
+
* this option should be the drawable resource ID, which is the filename
|
|
219
|
+
* without an extension.
|
|
220
|
+
*
|
|
221
|
+
* Only available for Android.
|
|
222
|
+
*
|
|
223
|
+
* @since 1.0.0
|
|
224
|
+
*/
|
|
34
225
|
largeIcon?: string;
|
|
35
|
-
|
|
226
|
+
/**
|
|
227
|
+
* Specifies the channel the notification should be delivered on.
|
|
228
|
+
*
|
|
229
|
+
* If channel with the given name does not exist then the notification will
|
|
230
|
+
* not fire. If not provided, it will use the default channel.
|
|
231
|
+
*
|
|
232
|
+
* Calls `setChannelId()` on
|
|
233
|
+
* [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)
|
|
234
|
+
* with the provided value.
|
|
235
|
+
*
|
|
236
|
+
* Only available for Android 26+.
|
|
237
|
+
*
|
|
238
|
+
* @since 1.0.0
|
|
239
|
+
*/
|
|
36
240
|
channelId?: string;
|
|
37
241
|
}
|
|
242
|
+
/**
|
|
243
|
+
* Get access to device location information.
|
|
244
|
+
*
|
|
245
|
+
* @since 1.0.0
|
|
246
|
+
*/
|
|
38
247
|
export interface CapacitorGeolocation {
|
|
248
|
+
/**
|
|
249
|
+
* Get the device's last known location
|
|
250
|
+
* @since 1.0.0
|
|
251
|
+
*/
|
|
39
252
|
getCurrentLocation: () => GetCurrentPositionResult;
|
|
40
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* A simple string key / value store backed by UserDefaults on iOS and Shared Preferences on Android.
|
|
256
|
+
*/
|
|
41
257
|
export interface CapacitorKV {
|
|
258
|
+
/**
|
|
259
|
+
* Set a string value with the given key.
|
|
260
|
+
*
|
|
261
|
+
* @param key
|
|
262
|
+
* @param value
|
|
263
|
+
* @returns
|
|
264
|
+
* @since 1.0.0
|
|
265
|
+
*/
|
|
42
266
|
set: (key: string, value: string) => void;
|
|
267
|
+
/**
|
|
268
|
+
* Get a string value for the given key.
|
|
269
|
+
* @param key
|
|
270
|
+
* @returns
|
|
271
|
+
* @since 1.0.0
|
|
272
|
+
*/
|
|
43
273
|
get: (key: string) => string;
|
|
274
|
+
/**
|
|
275
|
+
* Remove a value with the given key.
|
|
276
|
+
* @param key
|
|
277
|
+
* @returns
|
|
278
|
+
* @since 1.0.0
|
|
279
|
+
*/
|
|
44
280
|
remove: (key: string) => void;
|
|
45
281
|
}
|
|
282
|
+
/**
|
|
283
|
+
* Get information on the device, such as network connectivity and battery status.
|
|
284
|
+
*/
|
|
46
285
|
export interface CapacitorDevice {
|
|
286
|
+
/**
|
|
287
|
+
* Get the current battery status for the device.
|
|
288
|
+
*
|
|
289
|
+
* @since 1.0.0
|
|
290
|
+
*/
|
|
47
291
|
getBatteryStatus: () => BatteryStatus;
|
|
292
|
+
/**
|
|
293
|
+
* Get the current network status for the device.
|
|
294
|
+
*
|
|
295
|
+
* @since 1.0.0
|
|
296
|
+
*/
|
|
48
297
|
getNetworkStatus: () => NetworkStatus;
|
|
49
298
|
}
|
|
299
|
+
/**
|
|
300
|
+
* Send basic local notifications.
|
|
301
|
+
*/
|
|
50
302
|
export interface CapacitorNotifications {
|
|
303
|
+
/**
|
|
304
|
+
* Schedule a local notification
|
|
305
|
+
* @example `CapacitorNotifications.schedule()`
|
|
306
|
+
* @param options
|
|
307
|
+
* @returns void
|
|
308
|
+
* @since 1.0.0
|
|
309
|
+
*/
|
|
51
310
|
schedule: (options: NotificationScheduleOptions[]) => void;
|
|
52
311
|
}
|
|
312
|
+
export interface CapacitorAPI {
|
|
313
|
+
CapacitorDevice: CapacitorDevice;
|
|
314
|
+
CapacitorKV: CapacitorKV;
|
|
315
|
+
CapacitorNotifications: CapacitorNotifications;
|
|
316
|
+
CapacitorGeolocation: CapacitorGeolocation;
|
|
317
|
+
}
|
package/dist/esm/apis.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apis.js","sourceRoot":"","sources":["../../src/apis.ts"],"names":[],"mappings":"","sourcesContent":["export interface GetCurrentPositionResult {\n latitude: number;\n longitude: number;\n accuracy: number;\n altitude: number;\n altitudeAccuracy?: number;\n speed: number;\n heading: number;\n}\n\nexport interface BatteryStatus {\n batteryLevel: number;\n isCharging: boolean;\n}\n\nexport interface NetworkStatus {\n connected: boolean;\n connectionType: string;\n}\n\nexport interface NotificationScheduleOptions {\n id: number;\n title: string;\n body: string;\n scheduleAt: Date;\n sound?: string;\n actionTypeId?: string;\n threadIdentifier?: string;\n summaryArgument?: string;\n groupSummary?: string;\n extra?:
|
|
1
|
+
{"version":3,"file":"apis.js","sourceRoot":"","sources":["../../src/apis.ts"],"names":[],"mappings":"","sourcesContent":["export interface GetCurrentPositionResult {\n /**\n * Latitude in decimal degrees\n *\n * @since 1.0.0\n */\n latitude: number;\n /**\n * longitude in decimal degrees\n *\n * @since 1.0.0\n */\n longitude: number;\n /**\n * Accuracy level of the latitude and longitude coordinates in meters\n *\n * @since 1.0.0\n */\n accuracy: number;\n /**\n * The altitude the user is at (if available)\n *\n * @since 1.0.0\n */\n altitude: number | null;\n /**\n * Accuracy level of the altitude coordinate in meters, if available.\n *\n * Available on all iOS versions and on Android 8.0+.\n *\n * @since 1.0.0\n */\n altitudeAccuracy?: number | null | undefined;\n /**\n * The speed the user is traveling (if available)\n *\n * @since 1.0.0\n */\n speed: number | null;\n /**\n * The heading the user is facing (if available)\n *\n * @since 1.0.0\n */\n heading: number | null;\n}\n\nexport interface BatteryStatus {\n batteryLevel: number;\n isCharging: boolean;\n}\n\nexport interface NetworkStatus {\n connected: boolean;\n connectionType: string;\n}\n\nexport interface NotificationScheduleOptions {\n /**\n * The notification identifier.\n * On Android it's a 32-bit int.\n * So the value should be between -2147483648 and 2147483647 inclusive.\n *\n * @since 1.0.0\n */\n id: number;\n /**\n * The title of the notification.\n *\n * @since 1.0.0\n */\n title: string;\n /**\n * The body of the notification, shown below the title.\n *\n * @since 1.0.0\n */\n body: string;\n /**\n * Date to send this notification.\n *\n * @since 1.0.0\n */\n scheduleAt: Date;\n /**\n * Name of the audio file to play when this notification is displayed.\n *\n * Include the file extension with the filename.\n *\n * On iOS, the file should be in the app bundle.\n * On Android, the file should be in res/raw folder.\n *\n * Recommended format is `.wav` because is supported by both iOS and Android.\n *\n * Only available for iOS and Android < 26.\n * For Android 26+ use channelId of a channel configured with the desired sound.\n *\n * If the sound file is not found, (i.e. empty string or wrong name)\n * the default system notification sound will be used.\n * If not provided, it will produce the default sound on Android and no sound on iOS.\n *\n * @since 1.0.0\n */\n sound?: string;\n /**\n * Associate an action type with this notification.\n *\n * @since 1.0.0\n */\n actionTypeId?: string;\n /**\n * Used to group multiple notifications.\n *\n * Sets `threadIdentifier` on the\n * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n threadIdentifier?: string;\n /**\n * The string this notification adds to the category's summary format string.\n *\n * Sets `summaryArgument` on the\n * [`UNMutableNotificationContent`](https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent).\n *\n * Only available for iOS.\n *\n * @since 1.0.0\n */\n summaryArgument?: string;\n /**\n * Used to group multiple notifications.\n *\n * Calls `setGroup()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n group?: string;\n /**\n * If true, this notification becomes the summary for a group of\n * notifications.\n *\n * Calls `setGroupSummary()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android when using `group`.\n *\n * @since 1.0.0\n */\n groupSummary?: string;\n /**\n * Set extra data to store within this notification.\n *\n * @since 1.0.0\n */\n extra?: any;\n /**\n * If true, the notification can't be swiped away.\n *\n * Calls `setOngoing()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n ongoing?: boolean;\n /**\n * If true, the notification is canceled when the user clicks on it.\n *\n * Calls `setAutoCancel()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n autoCancel?: boolean;\n /**\n * Sets a multiline text block for display in a big text notification style.\n *\n * @since 1.0.0\n */\n largeBody?: string;\n /**\n * Used to set the summary text detail in inbox and big text notification styles.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n summaryText?: string;\n /**\n * Set a custom status bar icon.\n *\n * If set, this overrides the `smallIcon` option from Capacitor\n * configuration.\n *\n * Icons should be placed in your app's `res/drawable` folder. The value for\n * this option should be the drawable resource ID, which is the filename\n * without an extension.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n smallIcon?: string;\n /**\n * Set a large icon for notifications.\n *\n * Icons should be placed in your app's `res/drawable` folder. The value for\n * this option should be the drawable resource ID, which is the filename\n * without an extension.\n *\n * Only available for Android.\n *\n * @since 1.0.0\n */\n largeIcon?: string;\n /**\n * Specifies the channel the notification should be delivered on.\n *\n * If channel with the given name does not exist then the notification will\n * not fire. If not provided, it will use the default channel.\n *\n * Calls `setChannelId()` on\n * [`NotificationCompat.Builder`](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)\n * with the provided value.\n *\n * Only available for Android 26+.\n *\n * @since 1.0.0\n */\n channelId?: string;\n}\n\n/**\n * Get access to device location information.\n *\n * @since 1.0.0\n */\nexport interface CapacitorGeolocation {\n /**\n * Get the device's last known location\n * @since 1.0.0\n */\n getCurrentLocation: () => GetCurrentPositionResult;\n}\n\n/**\n * A simple string key / value store backed by UserDefaults on iOS and Shared Preferences on Android.\n */\nexport interface CapacitorKV {\n /**\n * Set a string value with the given key.\n *\n * @param key\n * @param value\n * @returns\n * @since 1.0.0\n */\n set: (key: string, value: string) => void;\n /**\n * Get a string value for the given key.\n * @param key\n * @returns\n * @since 1.0.0\n */\n get: (key: string) => string;\n /**\n * Remove a value with the given key.\n * @param key\n * @returns\n * @since 1.0.0\n */\n remove: (key: string) => void;\n}\n\n/**\n * Get information on the device, such as network connectivity and battery status.\n */\nexport interface CapacitorDevice {\n /**\n * Get the current battery status for the device.\n *\n * @since 1.0.0\n */\n getBatteryStatus: () => BatteryStatus;\n /**\n * Get the current network status for the device.\n *\n * @since 1.0.0\n */\n getNetworkStatus: () => NetworkStatus;\n}\n\n/**\n * Send basic local notifications.\n */\nexport interface CapacitorNotifications {\n /**\n * Schedule a local notification\n * @example `CapacitorNotifications.schedule()`\n * @param options\n * @returns void\n * @since 1.0.0\n */\n schedule: (options: NotificationScheduleOptions[]) => void;\n}\n\nexport interface CapacitorAPI {\n CapacitorDevice: CapacitorDevice;\n CapacitorKV: CapacitorKV;\n CapacitorNotifications: CapacitorNotifications;\n CapacitorGeolocation: CapacitorGeolocation;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/background-runner",
|
|
3
|
-
"version": "1.0.1-dev-
|
|
3
|
+
"version": "1.0.1-dev-20230807T230144.0",
|
|
4
4
|
"description": "Capacitor Background Runner",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -38,8 +38,9 @@
|
|
|
38
38
|
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
39
39
|
"swiftlint": "node-swiftlint",
|
|
40
40
|
"docgen": "docgen --api BackgroundRunnerPlugin --output-readme README.md --output-json dist/docs.json",
|
|
41
|
+
"docgen-api": "docgen --api CapacitorAPI --output-readme API.md --output-json dist/docs-api.json && node ./scripts/combine_docs.js",
|
|
41
42
|
"build-sdk": "./scripts/build-native-sdks.sh",
|
|
42
|
-
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js && npm run build-sdk && ./scripts/copy-native-sdks.sh && npm pack && mv ./capacitor-background-runner-*.tgz ../../",
|
|
43
|
+
"build": "npm run clean && npm run docgen && npm run docgen-api && tsc && rollup -c rollup.config.js && npm run build-sdk && ./scripts/copy-native-sdks.sh && npm pack && mv ./capacitor-background-runner-*.tgz ../../ && ./scripts/copy-readme.sh",
|
|
43
44
|
"pack": "npm run build && && ./scripts/copy-native-sdks.sh && npm pack && mv ./capacitor-background-runner-*.tgz ../../",
|
|
44
45
|
"clean": "rimraf ./dist",
|
|
45
46
|
"watch": "tsc --watch",
|
|
@@ -79,5 +80,5 @@
|
|
|
79
80
|
"src": "android"
|
|
80
81
|
}
|
|
81
82
|
},
|
|
82
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "0c7dde163121b218b5599b4aa072527daa37a771"
|
|
83
84
|
}
|