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
d74caf68
Commit
d74caf68
authored
Nov 08, 2015
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix getIds returns none existing notifications
parent
829501a9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
22 deletions
+20
-22
ClickActivity.java
src/android/ClickActivity.java
+5
-5
ClickActivity.java
src/android/notification/ClickActivity.java
+6
-0
Notification.java
src/android/notification/Notification.java
+5
-13
Options.java
src/android/notification/Options.java
+4
-4
No files found.
src/android/ClickActivity.java
View file @
d74caf68
...
...
@@ -44,13 +44,13 @@ public class ClickActivity extends de.appplant.cordova.plugin.notification.Click
public
void
onClick
(
Notification
notification
)
{
LocalNotification
.
fireEvent
(
"click"
,
notification
);
if
(!
notification
.
getOptions
().
isOngoing
())
{
String
event
=
notification
.
isRepeating
()
?
"clear"
:
"cancel"
;
super
.
onClick
(
notification
);
LocalNotification
.
fireEvent
(
event
,
notification
);
}
if
(
notification
.
getOptions
().
isOngoing
())
return
;
super
.
onClick
(
notification
);
String
event
=
notification
.
isRepeating
()
?
"clear"
:
"cancel"
;
LocalNotification
.
fireEvent
(
event
,
notification
);
}
/**
...
...
src/android/notification/ClickActivity.java
View file @
d74caf68
...
...
@@ -40,6 +40,12 @@ public class ClickActivity extends AbstractClickActivity {
@Override
public
void
onClick
(
Notification
notification
)
{
launchApp
();
if
(
notification
.
isRepeating
())
{
notification
.
clear
();
}
else
{
notification
.
cancel
();
}
}
/**
...
...
src/android/notification/Notification.java
View file @
d74caf68
...
...
@@ -144,8 +144,7 @@ public class Notification {
if
(!
options
.
getDict
().
has
(
"updatedAt"
))
return
false
;
long
now
=
new
Date
().
getTime
();
long
now
=
new
Date
().
getTime
();
long
updatedAt
=
options
.
getDict
().
optLong
(
"updatedAt"
,
now
);
return
(
now
-
updatedAt
)
<
1000
;
...
...
@@ -184,14 +183,14 @@ public class Notification {
/**
* Clear the local notification without canceling repeating alarms.
*
*/
public
void
clear
()
{
if
(!
isRepeating
()
&&
wasInThePast
())
{
if
(!
isRepeating
()
&&
wasInThePast
())
unpersist
();
}
else
{
if
(!
isRepeating
())
getNotMgr
().
cancel
(
getId
());
}
}
/**
...
...
@@ -240,13 +239,6 @@ public class Notification {
}
/**
* Show as modal dialog when in foreground.
*/
private
void
showDialog
()
{
// TODO
}
/**
* Count of triggers since schedule.
*/
public
int
getTriggerCountSinceSchedule
()
{
...
...
src/android/notification/Options.java
View file @
d74caf68
...
...
@@ -213,10 +213,10 @@ public class Options {
* Trigger date in milliseconds.
*/
public
long
getTriggerTime
()
{
return
Math
.
max
(
System
.
currentTimeMillis
(),
options
.
optLong
(
"at"
,
0
)
*
1000
);
//
return Math.max(
//
System.currentTimeMillis(),
return
options
.
optLong
(
"at"
,
0
)
*
1000
;
//
);
}
/**
...
...
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