Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cordova-plugin-local-notifications
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nabil Sadki
cordova-plugin-local-notifications
Commits
80069861
Commit
80069861
authored
Oct 30, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
94563ec3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
6 deletions
+65
-6
README.md
README.md
+65
-6
No files found.
README.md
View file @
80069861
...
...
@@ -223,12 +223,6 @@ cordova.plugins.notification.local.schedule({
});
```
And to get informed about the event triggered:
```
js
cordova
.
plugins
.
notification
.
local
.
on
(
'trigger'
,
function
(
toast
,
event
)
{
...
});
```
### Location based
To trigger when the user enters a region:
...
...
@@ -356,6 +350,71 @@ cordova.plugins.notification.local.schedule(toast, callback, scope, { skipPermis
```
## Events
The following events are supported:
`add`
,
`trigger`
,
`click`
,
`clear`
,
`cancel`
,
`update`
,
`clearall`
and
`cancelall`
.
```
js
cordova
.
plugins
.
notification
.
local
.
on
(
event
,
callback
,
scope
);
```
To unsubscribe from events:
```
js
cordova
.
plugins
.
notification
.
local
.
un
(
event
,
callback
,
scope
);
```
### Custom
The plugin also fires events specified by actions.
```
js
cordova
.
plugins
.
notification
.
local
.
schedule
({
title
:
'Do you want to go see a movie tonight?'
,
actions
:
[{
id
:
'yes'
,
title
:
'Yes'
}]
});
```
The name of the event is the id of the action.
```
js
cordova
.
plugins
.
notification
.
local
.
on
(
'yes'
,
function
(
notification
,
eopts
)
{
...
});
```
### Fire manually
Not an official interface, however its possible to manually fire events.
```
js
cordova
.
plugins
.
notification
.
local
.
core
.
fireEvent
(
event
,
args
);
```
## Launch Details
Check the
`launchDetails`
to find out if the app was launched by clicking on a notification.
```
js
document
.
addEventListener
(
'deviceready'
,
function
()
{
console
.
log
(
cordova
.
plugins
.
notification
.
local
.
launchDetails
);
},
false
);
```
## Methods
All methods work asynchron and accept callback methods.
See the sample app for how to use them.
| Method | Method | Method | Method | Method |
| :------- | :---------------- | :-------------- | :------------- | :---------- |
| schedule | cancelAll | isTriggered | get | getDefaults |
| update | hasPermission | getType | getAll | setDefaults |
| clear | requestPermission | getIds | getScheduled | on |
| clearAll | isPresent | getScheduledIds | getTriggered | un |
| cancel | isScheduled | getTriggeredIds | addActionGroup |
## Installation
The plugin can be installed via
[
Cordova-CLI
][
CLI
]
and is publicly available on
[
NPM
][
npm
]
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment