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
3a2ed5dc
Commit
3a2ed5dc
authored
Dec 08, 2015
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #732 loop between update and trigger
parent
fd647138
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
11 deletions
+13
-11
CHANGELOG.md
CHANGELOG.md
+1
-0
AbstractTriggerReceiver.java
src/android/notification/AbstractTriggerReceiver.java
+1
-1
Manager.java
src/android/notification/Manager.java
+1
-2
Notification.java
src/android/notification/Notification.java
+10
-8
No files found.
CHANGELOG.md
View file @
3a2ed5dc
...
...
@@ -5,6 +5,7 @@ Please also read the [Upgrade Guide](https://github.com/katzer/cordova-plugin-lo
#### Version 0.8.3 (not yet released)
-
New "quarter" intervall for iOS & Android
-
Fixed #732 loop between update and trigger (Android)
-
Fixed #710 crash due to >500 notifications (Android)
-
Fixed crashing
`get(ID)`
if notification doesn't exist
...
...
src/android/notification/AbstractTriggerReceiver.java
View file @
3a2ed5dc
...
...
@@ -70,7 +70,7 @@ abstract public class AbstractTriggerReceiver extends BroadcastReceiver {
Builder
builder
=
new
Builder
(
options
);
Notification
notification
=
buildNotification
(
builder
);
boolean
updated
=
notification
.
isUpdate
();
boolean
updated
=
notification
.
isUpdate
(
false
);
onTrigger
(
notification
,
updated
);
}
...
...
src/android/notification/Manager.java
View file @
3a2ed5dc
...
...
@@ -31,7 +31,6 @@ import org.json.JSONException;
import
org.json.JSONObject
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -121,7 +120,7 @@ public class Manager {
notification
.
getOptions
().
getDict
(),
updates
);
try
{
options
.
putOpt
(
"updated
At"
,
new
Date
().
getTime
()
);
options
.
putOpt
(
"updated
"
,
true
);
}
catch
(
JSONException
ignore
)
{}
return
schedule
(
options
,
receiver
);
...
...
src/android/notification/Notification.java
View file @
3a2ed5dc
...
...
@@ -138,16 +138,18 @@ public class Notification {
/**
* If the notification is an update.
*
* @param keepFlag
* Set to false to remove the flag from the option map
*/
protected
boolean
isUpdate
()
{
if
(!
options
.
getDict
().
has
(
"updatedAt"
))
return
false
;
protected
boolean
isUpdate
(
boolean
keepFlag
)
{
boolean
updated
=
options
.
getDict
().
optBoolean
(
"updated"
,
false
);
long
now
=
new
Date
().
getTime
();
long
updatedAt
=
options
.
getDict
().
optLong
(
"updatedAt"
,
now
);
if
(!
keepFlag
)
{
options
.
getDict
().
remove
(
"updated"
);
}
return
(
now
-
updatedAt
)
<
1000
;
return
updated
;
}
/**
...
...
@@ -268,7 +270,7 @@ public class Notification {
}
json
.
remove
(
"firstAt"
);
json
.
remove
(
"updated
At
"
);
json
.
remove
(
"updated"
);
json
.
remove
(
"soundUri"
);
json
.
remove
(
"iconUri"
);
...
...
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