Skip to content

Commit c1d73db

Browse files
chore(update-plugins): Mon Apr 4 08:05:21 UTC 2022
1 parent bb1ebe6 commit c1d73db

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

plugins/local-notifications.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,18 @@ From the command prompt go to your app's root folder and execute:
2727
#### NativeScript 7+:
2828

2929
```cli
30-
ns plugin add @nativescript/local-notifications
30+
npm install @nativescript/local-notifications
3131
```
3232

3333
#### NativeScript prior to 7:
3434

3535
```cli
36-
tns plugin add [email protected]
36+
tnpm install [email protected]
3737
```
3838

39-
## Setup (since plugin version 3.0.0)
39+
## Setup
40+
41+
### Since plugin version 3.0.0
4042

4143
Add this so for iOS 10+ we can do some wiring (set the iOS `UNUserNotificationCenter.delegate`, to be precise).
4244
Not needed if your app loads the plugin on startup anyway.
@@ -53,15 +55,15 @@ import * as LocalNotifications from '@nativescript/local-notifications'
5355
LocalNotifications.hasPermission()
5456
```
5557

56-
### NativeScript-Angular
57-
58-
This plugin is part of the [plugin showcase app](https://github.com/EddyVerbruggen/nativescript-pluginshowcase/tree/master/app/feedback) I built using Angular.
58+
### Since plugin version 6.0.0
5959

60-
There's also a simple Angular [demo in this repo](https://github.com/EddyVerbruggen/nativescript-local-notifications/tree/master/demo-ng):
60+
Both iOS and Android have to register their delegates and lifecycle callbacks respectively. Hence, if your app does not load this plugin at startup you will have to add the following to your app's `app.ts`/`main.ts` file:
6161

62-
### NativeScript-Vue
62+
```typescript
63+
import '@nativescript/local-notifications'
6364

64-
There is a [Vue demo](https://github.com/EddyVerbruggen/nativescript-local-notifications/tree/master/demo-vue):
65+
// ... Bootstrap application
66+
```
6567

6668
## Plugin API
6769

@@ -100,14 +102,14 @@ You can pass several options to this function, everything is optional:
100102

101103
#### `NotificationAction`
102104

103-
| option | description |
104-
| ------------- | ------------------------------------------------- |
105-
| `id` | An id so you can easily distinguish your actions. |
106-
| `type` | Either `button` or `input`. |
107-
| `title` | The label for `type` = `button`. |
108-
| `launch` | Launch the app when the action completes. |
109-
| `submitLabel` | The submit button label for `type` = `input`. |
110-
| `placeholder` | The placeholder text for `type` = `input`. |
105+
| option | description |
106+
| ------------- | ---------------------------------------------------------------------------------------------------------------------- |
107+
| `id` | An id so you can easily distinguish your actions. |
108+
| `type` | Either `button` or `input`. |
109+
| `title` | The label for `type` = `button`. |
110+
| `launch` | Launch the app when the action completes. This will only work in apps targeting Android 11 or lower (target SDK < 31). |
111+
| `submitLabel` | The submit button label for `type` = `input`. |
112+
| `placeholder` | The placeholder text for `type` = `input`. |
111113

112114
```js
113115
LocalNotifications.schedule([

0 commit comments

Comments
 (0)