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
208d13ea
Commit
208d13ea
authored
Feb 22, 2014
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added 'secondly' and 'minutely' as new repeat time aliases (Solves #102)
parent
f43aa60d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
README.md
README.md
+2
-1
Options.java
src/android/Options.java
+5
-1
APPLocalNotification.m
src/ios/APPLocalNotification.m
+4
-0
No files found.
README.md
View file @
208d13ea
...
...
@@ -54,6 +54,7 @@ More informations can be found [here](https://build.phonegap.com/plugins/413).
-
[
bugfix:
]
cancel callbacks have not been fired after all notifications have been canceled on iOS.
-
[
change:
]
The
`oncancel`
callback will be called at last if
`autoCancel`
is set to true (iOS).
-
[
bugfix:
]
Callbacks for non-repeating notifications were not called if they were not created in the current app instance on iOS.
-
[
enhancement:
]
Added 'secondly' and 'minutely' as new repeat time aliases.
#### Version 0.7.2 (09.02.2014)
-
[
enhancement:
]
Avoid blocking the main thread (on Android)
**(dpogue)**
.
...
...
@@ -141,7 +142,7 @@ window.plugin.notification.local.add({
date
:
Date
,
// This expects a date object
message
:
String
,
// The message that is displayed
title
:
String
,
// The title of the message
repeat
:
String
,
// Has the options of 'hourly', 'daily', 'weekly', 'monthly', 'yearly'
repeat
:
String
,
// Has the options of '
secondly', 'minutely', '
hourly', 'daily', 'weekly', 'monthly', 'yearly'
badge
:
Number
,
// Displays number badge to notification
sound
:
String
,
// A sound to be played
json
:
String
,
// Data to be passed through the notification
...
...
src/android/Options.java
View file @
208d13ea
...
...
@@ -58,7 +58,11 @@ public class Options {
this
.
options
=
options
;
if
(
repeat
.
equalsIgnoreCase
(
"hourly"
))
{
if
(
repeat
.
equalsIgnoreCase
(
"secondly"
))
{
interval
=
1000
;
}
if
(
repeat
.
equalsIgnoreCase
(
"minutely"
))
{
interval
=
AlarmManager
.
INTERVAL_FIFTEEN_MINUTES
/
15
;
}
if
(
repeat
.
equalsIgnoreCase
(
"hourly"
))
{
interval
=
AlarmManager
.
INTERVAL_HOUR
;
}
if
(
repeat
.
equalsIgnoreCase
(
"daily"
))
{
interval
=
AlarmManager
.
INTERVAL_DAY
;
...
...
src/ios/APPLocalNotification.m
View file @
208d13ea
...
...
@@ -199,12 +199,16 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
NSMutableDictionary
*
repeatDict
=
[[
NSMutableDictionary
alloc
]
init
];
#ifdef NSCalendarUnitHour
[
repeatDict
setObject
:[
NSNumber
numberWithInt
:
NSCalendarUnitSecond
]
forKey
:
@"secondly"
];
[
repeatDict
setObject
:[
NSNumber
numberWithInt
:
NSCalendarUnitMinute
]
forKey
:
@"minutely"
];
[
repeatDict
setObject
:[
NSNumber
numberWithInt
:
NSCalendarUnitHour
]
forKey
:
@"hourly"
];
[
repeatDict
setObject
:[
NSNumber
numberWithInt
:
NSCalendarUnitDay
]
forKey
:
@"daily"
];
[
repeatDict
setObject
:[
NSNumber
numberWithInt
:
NSWeekCalendarUnit
]
forKey
:
@"weekly"
];
[
repeatDict
setObject
:[
NSNumber
numberWithInt
:
NSCalendarUnitMonth
]
forKey
:
@"monthly"
];
[
repeatDict
setObject
:[
NSNumber
numberWithInt
:
NSCalendarUnitYear
]
forKey
:
@"yearly"
];
#else
[
repeatDict
setObject
:[
NSNumber
numberWithInt
:
NSSecondCalendarUnit
]
forKey
:
@"secondly"
];
[
repeatDict
setObject
:[
NSNumber
numberWithInt
:
NSMinuteCalendarUnit
]
forKey
:
@"minutely"
];
[
repeatDict
setObject
:[
NSNumber
numberWithInt
:
NSHourCalendarUnit
]
forKey
:
@"hourly"
];
[
repeatDict
setObject
:[
NSNumber
numberWithInt
:
NSDayCalendarUnit
]
forKey
:
@"daily"
];
[
repeatDict
setObject
:[
NSNumber
numberWithInt
:
NSWeekCalendarUnit
]
forKey
:
@"weekly"
];
...
...
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