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
f0de5c0f
Commit
f0de5c0f
authored
Nov 27, 2013
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
f93afde2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
12 deletions
+22
-12
README.md
README.md
+22
-12
No files found.
README.md
View file @
f0de5c0f
...
@@ -93,17 +93,20 @@ window.plugin.notification.local.cancelAll();
...
@@ -93,17 +93,20 @@ window.plugin.notification.local.cancelAll();
```
```
## Example
## Example
s
```
javascript
```
javascript
var
now
=
new
Date
().
getTime
(),
var
now
=
new
Date
().
getTime
(),
_60_seconds_from_now
=
new
Date
(
now
+
60
*
1000
);
_60_seconds_from_now
=
new
Date
(
now
+
60
*
1000
);
/**
* Will fire every week on this day, 60 seconds from now.
*/
window
.
plugin
.
notification
.
local
.
add
({
window
.
plugin
.
notification
.
local
.
add
({
id
:
1
,
// is converted to a string
id
:
1
,
// is converted to a string
title
:
'Great app!'
,
message
:
'Reminder'
,
repeat
:
'Dont forget to buy some flowers.'
,
date
:
_60_seconds_from_now
,
date
:
_60_seconds_from_now
,
message
:
'Hello world!'
,
title
:
'Check that out!'
,
repeat
:
'weekly'
,
// will fire every week on this day
foreground
:
'foreground'
,
foreground
:
'foreground'
,
background
:
'background'
background
:
'background'
});
});
...
@@ -116,6 +119,18 @@ function background (id) {
...
@@ -116,6 +119,18 @@ function background (id) {
console
.
log
(
'I WAS IN THE BACKGROUND ID='
+
id
)
console
.
log
(
'I WAS IN THE BACKGROUND ID='
+
id
)
}
}
```
```
```
javascript
/**
* Pop's up immediately
*/
window
.
plugin
.
notification
.
local
.
add
({
message
:
'Great app!'
});
```
```
javascript
/**
* Plays no sound if the notification pop's up
*/
window
.
plugin
.
notification
.
local
.
add
({
sound
:
null
});
```
## Platform specifics
## Platform specifics
...
@@ -138,26 +153,21 @@ The default sound is `RingtoneManager.TYPE_NOTIFICATION`. But an specific sound
...
@@ -138,26 +153,21 @@ The default sound is `RingtoneManager.TYPE_NOTIFICATION`. But an specific sound
The sound must be a absolute or relative Uri pointing to the sound file.
The sound must be a absolute or relative Uri pointing to the sound file.
```
javascript
```
javascript
/**
/**
* Plays the sound if the notification pop's up
.
* Plays the sound if the notification pop's up
*/
*/
window
.
plugin
.
notification
.
local
.
add
({
sound
:
'res/sounds/beep.mp3'
});
window
.
plugin
.
notification
.
local
.
add
({
sound
:
'res/sounds/beep.mp3'
});
/**
/**
* Plays the `RingtoneManager.TYPE_ALARM` sound
.
* Plays the `RingtoneManager.TYPE_ALARM` sound
*/
*/
window
.
plugin
.
notification
.
local
.
add
({
sound
:
'TYPE_ALARM'
});
window
.
plugin
.
notification
.
local
.
add
({
sound
:
'TYPE_ALARM'
});
/**
* Plays no sound if the notification pop's up.
*/
window
.
plugin
.
notification
.
local
.
add
({
sound
:
null
});
```
```
### Notification sound on iOS
### Notification sound on iOS
The sound must be located in your project's resources and must be a caf file.
The sound must be located in your project's resources and must be a caf file.
```
javascript
```
javascript
/**
/**
* Plays the sound if the notification pop's up
.
* Plays the sound if the notification pop's up
*/
*/
window
.
plugin
.
notification
.
local
.
add
({
sound
:
'sub.caf'
});
window
.
plugin
.
notification
.
local
.
add
({
sound
:
'sub.caf'
});
```
```
...
...
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