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
99df92d9
Commit
99df92d9
authored
Nov 08, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for firstAt on Android
parent
63aa4c00
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
7 deletions
+28
-7
README.md
README.md
+3
-4
Request.java
src/android/notification/Request.java
+7
-1
local-notification-util.js
www/local-notification-util.js
+18
-2
No files found.
README.md
View file @
99df92d9
...
...
@@ -263,7 +263,7 @@ The properties depend on the trigger type. Not all of them are supported across
| Type | Property | Type | Value | Android | iOS | Windows |
| :----------- | :------------ | :------ | :--------------- | :------ | :-- | :------ |
| Fix |
| | at | Date | |
x
| x | x |
| | at | Date | |
x
| x | x |
| Timespan |
| | in | Int | | x | x | x |
| | unit | String |
`second`
| x | x | x |
...
...
@@ -283,8 +283,7 @@ The properties depend on the trigger type. Not all of them are supported across
| | every | String |
`month`
| x | x | x |
| | every | String |
`year`
| x | x | x |
| | before | Date | |
| | firstAt | Date | |
| | after | Date | |
| | firstAt | Date | | x |
| Match |
| | count | Int | | x | | x |
| | every | Object |
`minute`
| x | x | x |
...
...
@@ -298,7 +297,7 @@ The properties depend on the trigger type. Not all of them are supported across
| | every | Object |
`quarter`
| | x |
| | every | Object |
`year`
| x | x | x |
| | before | Date | |
| | after | Date | |
| | after | Date | |
x |
| Location |
| | center | Array |
`[lat, long]`
| | x |
| | radius | Int | | | x |
...
...
src/android/notification/Request.java
View file @
99df92d9
...
...
@@ -241,7 +241,13 @@ public final class Request {
*/
private
Date
getBaseDate
()
{
if
(
spec
.
has
(
"at"
))
{
return
new
Date
(
spec
.
optLong
(
"at"
,
0
)
*
1000
);
return
new
Date
(
1000
*
spec
.
optLong
(
"at"
,
0
));
}
else
if
(
spec
.
has
(
"firstAt"
))
{
return
new
Date
(
1000
*
spec
.
optLong
(
"firstAt"
,
0
));
}
else
if
(
spec
.
has
(
"after"
))
{
return
new
Date
(
1000
*
spec
.
optLong
(
"after"
,
0
));
}
else
{
return
new
Date
();
}
...
...
www/local-notification-util.js
View file @
99df92d9
...
...
@@ -201,6 +201,11 @@ exports.convertTrigger = function (options) {
var
trigger
=
options
.
trigger
||
{},
date
=
this
.
getValueFor
(
trigger
,
'at'
,
'firstAt'
,
'date'
);
var
dateToNum
=
function
(
date
)
{
var
num
=
typeof
date
==
'object'
?
date
.
getTime
()
:
date
;
return
Math
.
round
(
num
/
1000
);
};
if
(
!
options
.
trigger
)
return
;
...
...
@@ -223,8 +228,19 @@ exports.convertTrigger = function (options) {
}
if
(
isCal
&&
date
)
{
date
=
typeof
date
==
'object'
?
date
.
getTime
()
:
date
;
trigger
.
at
=
Math
.
round
(
date
/
1000
);
trigger
.
at
=
dateToNum
(
date
);
}
if
(
isCal
&&
trigger
.
firstAt
)
{
trigger
.
firstAt
=
dateToNum
(
trigger
.
firstAt
);
}
if
(
isCal
&&
trigger
.
before
)
{
trigger
.
before
=
dateToNum
(
trigger
.
before
);
}
if
(
isCal
&&
trigger
.
after
)
{
trigger
.
after
=
dateToNum
(
trigger
.
after
);
}
if
(
!
trigger
.
count
&&
device
.
platform
==
'windows'
)
{
...
...
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