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
6872b219
Commit
6872b219
authored
Mar 03, 2015
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sendJavascript synchronized
parent
30ef6817
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
LocalNotification.java
src/android/LocalNotification.java
+8
-8
No files found.
src/android/LocalNotification.java
View file @
6872b219
...
@@ -177,14 +177,14 @@ public class LocalNotification extends CordovaPlugin {
...
@@ -177,14 +177,14 @@ public class LocalNotification extends CordovaPlugin {
* Properties for each local notification
* Properties for each local notification
*/
*/
private
void
schedule
(
JSONArray
notifications
)
{
private
void
schedule
(
JSONArray
notifications
)
{
for
(
int
i
=
0
;
i
<
notifications
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
notifications
.
length
();
i
++)
{
JSONObject
options
=
notifications
.
optJSONObject
(
i
);
JSONObject
options
=
notifications
.
optJSONObject
(
i
);
Notification
notification
=
Notification
notification
=
getNotificationMgr
().
schedule
(
options
,
TriggerReceiver
.
class
);
getNotificationMgr
().
schedule
(
options
,
TriggerReceiver
.
class
);
fireEvent
(
"schedule"
,
notification
);
fireEvent
(
"schedule"
,
notification
);
}
}
}
}
/**
/**
...
@@ -251,7 +251,7 @@ public class LocalNotification extends CordovaPlugin {
...
@@ -251,7 +251,7 @@ public class LocalNotification extends CordovaPlugin {
* Clear all triggered notifications without canceling them.
* Clear all triggered notifications without canceling them.
*/
*/
private
void
clearAll
()
{
private
void
clearAll
()
{
getNotificationMgr
().
clearAll
();
getNotificationMgr
().
clearAll
();
fireEvent
(
"clearall"
);
fireEvent
(
"clearall"
);
}
}
...
@@ -441,14 +441,14 @@ public class LocalNotification extends CordovaPlugin {
...
@@ -441,14 +441,14 @@ public class LocalNotification extends CordovaPlugin {
* Optional local notification to pass the id and properties.
* Optional local notification to pass the id and properties.
*/
*/
static
void
fireEvent
(
String
event
,
Notification
notification
)
{
static
void
fireEvent
(
String
event
,
Notification
notification
)
{
String
state
=
getApplicationState
();
String
state
=
getApplicationState
();
String
params
=
"\""
+
state
+
"\""
;
String
params
=
"\""
+
state
+
"\""
;
if
(
notification
!=
null
)
{
if
(
notification
!=
null
)
{
params
=
notification
.
toString
()
+
","
+
params
;
params
=
notification
.
toString
()
+
","
+
params
;
}
}
String
js
=
"cordova.plugins.notification.local.fireEvent("
+
String
js
=
"cordova.plugins.notification.local.fireEvent("
+
"\""
+
event
+
"\","
+
params
+
")"
;
"\""
+
event
+
"\","
+
params
+
")"
;
sendJavascript
(
js
);
sendJavascript
(
js
);
...
@@ -460,7 +460,7 @@ public class LocalNotification extends CordovaPlugin {
...
@@ -460,7 +460,7 @@ public class LocalNotification extends CordovaPlugin {
* @param js
* @param js
* JS code snippet as string
* JS code snippet as string
*/
*/
private
static
void
sendJavascript
(
final
String
js
)
{
private
static
synchronized
void
sendJavascript
(
final
String
js
)
{
if
(!
deviceready
)
{
if
(!
deviceready
)
{
eventQueue
.
add
(
js
);
eventQueue
.
add
(
js
);
...
...
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