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
c2daf399
Commit
c2daf399
authored
Dec 27, 2013
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only exec callbacks if they are not null or empty
parent
97f54d9e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
Receiver.java
src/android/Receiver.java
+2
-1
ReceiverActivity.java
src/android/ReceiverActivity.java
+2
-1
No files found.
src/android/Receiver.java
View file @
c2daf399
...
...
@@ -38,6 +38,7 @@ import android.content.Context;
import
android.content.Intent
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
/**
* The alarm receiver is triggered when a scheduled alarm is fired. This class
...
...
@@ -181,7 +182,7 @@ public class Receiver extends BroadcastReceiver {
// after reboot, LocalNotification.webView is always null
// may be call foreground callback later
if
(
function
!=
null
&&
LocalNotification
.
webView
!=
null
)
{
if
(!
TextUtils
.
isEmpty
(
function
)
&&
LocalNotification
.
webView
!=
null
)
{
LocalNotification
.
webView
.
sendJavascript
(
function
+
"("
+
options
.
getId
()
+
")"
);
}
}
...
...
src/android/ReceiverActivity.java
View file @
c2daf399
...
...
@@ -28,6 +28,7 @@ import android.app.Activity;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
public
class
ReceiverActivity
extends
Activity
{
...
...
@@ -74,7 +75,7 @@ public class ReceiverActivity extends Activity {
// after reboot, LocalNotification.webView is always null
// may be call background callback later
if
(
function
!=
null
&&
LocalNotification
.
webView
!=
null
)
{
if
(
!
TextUtils
.
isEmpty
(
function
)
&&
LocalNotification
.
webView
!=
null
)
{
LocalNotification
.
webView
.
sendJavascript
(
"setTimeout('"
+
function
+
"("
+
options
.
getId
()
+
")',0)"
);
}
}
...
...
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