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
580ec8b3
Commit
580ec8b3
authored
Oct 19, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use setExact to trigger at exact time
parent
b9387a0d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
Manager.java
src/android/notification/Manager.java
+16
-9
No files found.
src/android/notification/Manager.java
View file @
580ec8b3
...
...
@@ -28,6 +28,7 @@ import android.app.PendingIntent;
import
android.content.BroadcastReceiver
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.service.notification.StatusBarNotification
;
import
android.support.v4.app.NotificationManagerCompat
;
import
java.util.Date
;
...
...
@@ -77,7 +78,7 @@ public final class Manager {
* Check if app has local notification permission.
*/
public
boolean
hasPermission
()
{
return
getNotMgr
().
areNotificationsEnabled
();
return
getNot
Comp
Mgr
().
areNotificationsEnabled
();
}
/**
...
...
@@ -108,7 +109,7 @@ public final class Manager {
context
,
0
,
intent
,
PendingIntent
.
FLAG_CANCEL_CURRENT
);
try
{
mgr
.
set
(
AlarmManager
.
RTC_WAKEUP
,
date
.
getTime
(),
pi
);
mgr
.
set
Exact
(
AlarmManager
.
RTC_WAKEUP
,
date
.
getTime
(),
pi
);
}
catch
(
Exception
ignore
)
{
// on some Samsung devices there is a known bug where a 500 alarms limit can crash the app
// http://developer.samsung.com/forum/board/thread/view.do?boardName=General&messageId=280286&listLines=15&startId=zzzzz%7E&searchSubId=0000000001
...
...
@@ -144,8 +145,7 @@ public final class Manager {
* TODO: temporary
*/
private
void
createDefaultChannel
()
{
NotificationManager
mgr
=
(
NotificationManager
)
context
.
getSystemService
(
Context
.
NOTIFICATION_SERVICE
);
NotificationManager
mgr
=
getNotMgr
();
if
(
SDK_INT
<
O
)
return
;
...
...
@@ -192,8 +192,7 @@ public final class Manager {
// /**
// * Clear local notification specified by ID.
// *
// * @param id
// * The notification ID
// * @param id The notification ID.
// */
// public Notification clear (int id) {
// Notification notification = get(id);
...
...
@@ -209,7 +208,7 @@ public final class Manager {
* Clear all local notifications.
*/
public
void
clearAll
()
{
getNotMgr
().
cancelAll
();
getNot
Comp
Mgr
().
cancelAll
();
}
// /**
...
...
@@ -238,7 +237,7 @@ public final class Manager {
// notification.cancel();
// }
// getNotMgr().cancelAll();
// getNot
Comp
Mgr().cancelAll();
// }
// /**
...
...
@@ -515,7 +514,15 @@ public final class Manager {
/**
* Notification manager for the application.
*/
private
NotificationManagerCompat
getNotMgr
()
{
private
NotificationManager
getNotMgr
()
{
return
(
NotificationManager
)
context
.
getSystemService
(
Context
.
NOTIFICATION_SERVICE
);
}
/**
* Notification compat manager for the application.
*/
private
NotificationManagerCompat
getNotCompMgr
()
{
return
NotificationManagerCompat
.
from
(
context
);
}
...
...
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