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
55a367e8
Commit
55a367e8
authored
Feb 13, 2018
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not queue trigger or clear events
parent
69e49661
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
4 deletions
+18
-4
ClearReceiver.java
src/android/ClearReceiver.java
+5
-1
ClickReceiver.java
src/android/ClickReceiver.java
+2
-1
LocalNotification.java
src/android/LocalNotification.java
+7
-0
TriggerReceiver.java
src/android/TriggerReceiver.java
+4
-2
No files found.
src/android/ClearReceiver.java
View file @
55a367e8
...
...
@@ -26,6 +26,8 @@ import android.os.Bundle;
import
de.appplant.cordova.plugin.notification.Notification
;
import
de.appplant.cordova.plugin.notification.receiver.AbstractClearReceiver
;
import
static
de
.
appplant
.
cordova
.
plugin
.
localnotification
.
LocalNotification
.
fireEvent
;
import
static
de
.
appplant
.
cordova
.
plugin
.
localnotification
.
LocalNotification
.
isAppRunning
;
import
static
de
.
appplant
.
cordova
.
plugin
.
notification
.
Request
.
EXTRA_LAST
;
/**
...
...
@@ -51,7 +53,9 @@ public class ClearReceiver extends AbstractClearReceiver {
notification
.
clear
();
}
LocalNotification
.
fireEvent
(
"clear"
,
notification
);
if
(
isAppRunning
())
{
fireEvent
(
"clear"
,
notification
);
}
}
}
src/android/ClickReceiver.java
View file @
55a367e8
...
...
@@ -30,6 +30,7 @@ import org.json.JSONObject;
import
de.appplant.cordova.plugin.notification.Notification
;
import
de.appplant.cordova.plugin.notification.receiver.AbstractClickReceiver
;
import
static
de
.
appplant
.
cordova
.
plugin
.
localnotification
.
LocalNotification
.
fireEvent
;
import
static
de
.
appplant
.
cordova
.
plugin
.
notification
.
Options
.
EXTRA_LAUNCH
;
import
static
de
.
appplant
.
cordova
.
plugin
.
notification
.
Request
.
EXTRA_LAST
;
...
...
@@ -54,7 +55,7 @@ public class ClickReceiver extends AbstractClickReceiver {
setTextInput
(
action
,
data
);
launchAppIf
();
LocalNotification
.
fireEvent
(
action
,
notification
,
data
);
fireEvent
(
action
,
notification
,
data
);
if
(
notification
.
getOptions
().
isSticky
())
return
;
...
...
src/android/LocalNotification.java
View file @
55a367e8
...
...
@@ -583,6 +583,13 @@ public class LocalNotification extends CordovaPlugin {
}
/**
* If the app is running.
*/
static
boolean
isAppRunning
()
{
return
webView
!=
null
;
}
/**
* Convert JSON array of integers to List.
*
* @param ary Array of integers.
...
...
src/android/TriggerReceiver.java
View file @
55a367e8
...
...
@@ -37,6 +37,8 @@ import de.appplant.cordova.plugin.notification.receiver.AbstractTriggerReceiver;
import
static
android
.
content
.
Context
.
POWER_SERVICE
;
import
static
android
.
os
.
Build
.
VERSION
.
SDK_INT
;
import
static
android
.
os
.
Build
.
VERSION_CODES
.
LOLLIPOP
;
import
static
de
.
appplant
.
cordova
.
plugin
.
localnotification
.
LocalNotification
.
fireEvent
;
import
static
de
.
appplant
.
cordova
.
plugin
.
localnotification
.
LocalNotification
.
isAppRunning
;
import
static
java
.
util
.
Calendar
.
MINUTE
;
/**
...
...
@@ -72,8 +74,8 @@ public class TriggerReceiver extends AbstractTriggerReceiver {
notification
.
show
();
if
(!
isUpdate
)
{
LocalNotification
.
fireEvent
(
"trigger"
,
notification
);
if
(!
isUpdate
&&
isAppRunning
()
)
{
fireEvent
(
"trigger"
,
notification
);
}
if
(!
options
.
isInfiniteTrigger
())
...
...
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