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
4040cf61
Commit
4040cf61
authored
Aug 11, 2013
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:katzer/cordova-plugin-local-notifications
parents
9f840754
bf7af5d4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
1 deletions
+69
-1
README.md
README.md
+69
-1
No files found.
README.md
View file @
4040cf61
cordova-plugin-local-notifications
Cordova LocalNotification-Plugin
==================================
==================================
A bunch of local-notification plugins for Cordova 3.x.x
A bunch of local-notification plugins for Cordova 3.x.x
by Sebastián Katzer (
[
github.com/katzer
](
https://github.com/katzer
)
)
## Supported Platforms ##
-
**iOS**
## Adding the Plugin to your project ##
Through the
[
Command-line Interface
](
http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface
)
:
```
cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications.git
```
## Release Notes ##
#### Version 0.1.0 (10.08.2013) ####
-
Added iOS support
## Using the plugin ##
The plugin creates the object
```window.plugin.notification.local```
with three methods:
### add() ###
To add a custom notification:
```
javascript
window
.
plugin
.
notification
.
local
.
add
({
date
:
date
,
// this expects a date object
message
:
message
,
// the message that is displayed
repeat
:
repeat
,
// has the options of 'weekly','daily','monthly','yearly')
badge
:
badge
,
// displays number badge to notification
foreground
:
forground
,
// a javascript function to be called if the app is running
background
:
background
,
// a javascript function to be called if the app is in the background
sound
:
sound
// a sound to be played, the sound must be located in your project's resources and must be a caf file
});
```
### clear() ###
To clear a specific notification:
```
javascript
window
.
plugin
.
notification
.
local
.
clear
(
__id__
);
```
### clearAll() ###
To clear all notifications:
```
javascript
window
.
plugin
.
notification
.
local
.
clearAll
();
```
#### Example ####
```
javascript
var
now
=
new
Date
().
getTime
(),
_60_seconds_from_now
=
new
Date
(
now
+
60
*
1000
);
window
.
plugin
.
notification
.
local
.
add
({
date
:
_60_seconds_from_now
,
message
:
'Hello world!'
,
repeat
:
'weekly'
,
// will fire every week on this day
badge
:
1
,
foreground
:
'foreground'
,
background
:
'background'
,
sound
:
'sub.caf'
});
function
foreground
(
id
)
{
console
.
log
(
'I WAS RUNNING ID='
+
id
)
}
function
background
(
id
)
{
console
.
log
(
'I WAS IN THE BACKGROUND ID='
+
id
)
}
```
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