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
40461306
Commit
40461306
authored
Feb 05, 2014
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`onadd` was called each time after a repeating message was triggered
parent
7c642208
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
9 deletions
+17
-9
README.md
README.md
+4
-1
LocalNotification.java
src/android/LocalNotification.java
+11
-6
Receiver.java
src/android/Receiver.java
+1
-1
Restore.java
src/android/Restore.java
+1
-1
No files found.
README.md
View file @
40461306
...
@@ -46,11 +46,14 @@ or to use this exact version:
...
@@ -46,11 +46,14 @@ or to use this exact version:
More informations can be found
[
here
](
https://build.phonegap.com/plugins/413
)
.
More informations can be found
[
here
](
https://build.phonegap.com/plugins/413
)
.
## Release Notes
## Release Notes
#### Version 0.7.2 (not yet released)
-
[
enhancement:
]
Avoid blocking the main thread (on Android)
**(dpogue)**
.
-
[
bugfix:
]
`onadd`
was called each time after a repeating message was triggered (Android)
#### Version 0.7.1 (31.01.2014)
#### Version 0.7.1 (31.01.2014)
-
[
bugfix:
]
`ongoing`
attribute was ignored.
-
[
bugfix:
]
`ongoing`
attribute was ignored.
-
[
bugfix:
]
`oncancel`
wasnt fired if
`autoCancel`
was set to true.
-
[
bugfix:
]
`oncancel`
wasnt fired if
`autoCancel`
was set to true.
-
[
bugfix:
]
App throwed an error at restart if a callback was registered.
-
[
bugfix:
]
App throwed an error at restart if a callback was registered.
-
[
enhancement:
]
Avoid blocking the main thread (on Android)
**(dpogue)**
.
#### Version 0.7.0 (22.01.2014)
#### Version 0.7.0 (22.01.2014)
**Note:**
The new way of callback registration will be not compatible with previous versions! See #62
**Note:**
The new way of callback registration will be not compatible with previous versions! See #62
...
...
src/android/LocalNotification.java
View file @
40461306
...
@@ -72,11 +72,11 @@ public class LocalNotification extends CordovaPlugin {
...
@@ -72,11 +72,11 @@ public class LocalNotification extends CordovaPlugin {
if
(
action
.
equalsIgnoreCase
(
"add"
))
{
if
(
action
.
equalsIgnoreCase
(
"add"
))
{
cordova
.
getThreadPool
().
execute
(
new
Runnable
()
{
cordova
.
getThreadPool
().
execute
(
new
Runnable
()
{
public
void
run
()
{
public
void
run
()
{
JSONObject
arguments
=
args
.
optJSONObject
(
0
);
JSONObject
arguments
=
args
.
optJSONObject
(
0
);
Options
options
=
new
Options
(
context
).
parse
(
arguments
);
Options
options
=
new
Options
(
context
).
parse
(
arguments
);
persist
(
options
.
getId
(),
args
);
persist
(
options
.
getId
(),
args
);
add
(
options
);
add
(
options
,
true
);
}
}
});
});
...
@@ -116,8 +116,10 @@ public class LocalNotification extends CordovaPlugin {
...
@@ -116,8 +116,10 @@ public class LocalNotification extends CordovaPlugin {
*
*
* @param options
* @param options
* The options that can be specified per alarm.
* The options that can be specified per alarm.
* @param doFireEvent
* If the onadd callback shall be called.
*/
*/
public
static
void
add
(
Options
options
)
{
public
static
void
add
(
Options
options
,
boolean
doFireEvent
)
{
long
triggerTime
=
options
.
getDate
();
long
triggerTime
=
options
.
getDate
();
Intent
intent
=
new
Intent
(
context
,
Receiver
.
class
)
Intent
intent
=
new
Intent
(
context
,
Receiver
.
class
)
...
@@ -127,7 +129,9 @@ public class LocalNotification extends CordovaPlugin {
...
@@ -127,7 +129,9 @@ public class LocalNotification extends CordovaPlugin {
AlarmManager
am
=
getAlarmManager
();
AlarmManager
am
=
getAlarmManager
();
PendingIntent
pi
=
PendingIntent
.
getBroadcast
(
context
,
0
,
intent
,
PendingIntent
.
FLAG_CANCEL_CURRENT
);
PendingIntent
pi
=
PendingIntent
.
getBroadcast
(
context
,
0
,
intent
,
PendingIntent
.
FLAG_CANCEL_CURRENT
);
fireEvent
(
"add"
,
options
.
getId
(),
options
.
getJSON
());
if
(
doFireEvent
)
{
fireEvent
(
"add"
,
options
.
getId
(),
options
.
getJSON
());
}
am
.
set
(
AlarmManager
.
RTC_WAKEUP
,
triggerTime
,
pi
);
am
.
set
(
AlarmManager
.
RTC_WAKEUP
,
triggerTime
,
pi
);
}
}
...
@@ -299,4 +303,4 @@ public class LocalNotification extends CordovaPlugin {
...
@@ -299,4 +303,4 @@ public class LocalNotification extends CordovaPlugin {
callbackQueue
.
clear
();
callbackQueue
.
clear
();
}
}
}
}
\ No newline at end of file
src/android/Receiver.java
View file @
40461306
...
@@ -79,7 +79,7 @@ public class Receiver extends BroadcastReceiver {
...
@@ -79,7 +79,7 @@ public class Receiver extends BroadcastReceiver {
}
else
if
(
isFirstAlarmInFuture
())
{
}
else
if
(
isFirstAlarmInFuture
())
{
return
;
return
;
}
else
{
}
else
{
LocalNotification
.
add
(
options
.
moveDate
());
LocalNotification
.
add
(
options
.
moveDate
()
,
false
);
}
}
Builder
notification
=
buildNotification
();
Builder
notification
=
buildNotification
();
...
...
src/android/Restore.java
View file @
40461306
...
@@ -59,7 +59,7 @@ public class Restore extends BroadcastReceiver {
...
@@ -59,7 +59,7 @@ public class Restore extends BroadcastReceiver {
/*
/*
* If the trigger date was in the past, the notification will be displayed immediately.
* If the trigger date was in the past, the notification will be displayed immediately.
*/
*/
LocalNotification
.
add
(
options
);
LocalNotification
.
add
(
options
,
false
);
}
catch
(
JSONException
e
)
{}
}
catch
(
JSONException
e
)
{}
}
}
...
...
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