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
aacd804f
Commit
aacd804f
authored
Dec 04, 2013
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix: Android notification is shown when the app is not running.
parent
d3367090
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
0 deletions
+15
-0
README.md
README.md
+1
-0
LocalNotification.java
src/android/LocalNotification.java
+9
-0
Receiver.java
src/android/Receiver.java
+3
-0
Restore.java
src/android/Restore.java
+2
-0
No files found.
README.md
View file @
aacd804f
...
...
@@ -46,6 +46,7 @@ cordova plugin rm de.appplant.cordova.plugin.local-notifications
-
[
bugfix:
]
`cancel`
on iOS did not work do to wrong param type.
-
[
enhancement:
]
`cancel`
&
`cancelAll`
remove the notification(s) from notification center as well on Android.
-
[
bugfix:
]
Missing background callback on Android.
-
[
bugfix:
]
Android notification is not shown when the app is not running.
#### Version 0.6.0 (16.11.2013)
-
Added WP8 support
<br>
...
...
src/android/LocalNotification.java
View file @
aacd804f
...
...
@@ -194,6 +194,15 @@ public class LocalNotification extends CordovaPlugin {
}
/**
* Set the application context if not already set.
*/
public
static
void
setContext
(
Context
context
)
{
if
(
this
.
context
==
null
)
{
this
.
context
=
context
;
}
}
/**
* The Local storage for the application.
*/
public
static
SharedPreferences
getSharedPreferences
()
{
...
...
src/android/Receiver.java
View file @
aacd804f
...
...
@@ -54,6 +54,9 @@ public class Receiver extends BroadcastReceiver {
this
.
context
=
context
;
this
.
options
=
options
;
// The context may got lost if the app was not running before
LocalNotification
.
setContext
(
context
);
if
(
options
.
getInterval
()
==
0
)
{
LocalNotification
.
unpersist
(
options
.
getId
());
}
else
if
(
isFirstAlarmInFuture
())
{
...
...
src/android/Restore.java
View file @
aacd804f
...
...
@@ -40,6 +40,8 @@ public class Restore extends BroadcastReceiver {
JSONArray
args
=
new
JSONArray
(
alarms
.
getString
(
alarmId
,
""
));
Options
options
=
new
Options
(
context
).
parse
(
args
.
getJSONObject
(
0
));
// The context got lost after reboot
LocalNotification
.
setContext
(
context
);
LocalNotification
.
add
(
options
);
}
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