Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
permission_handler
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
songyanzhi
permission_handler
Commits
28bb7af0
Commit
28bb7af0
authored
Oct 23, 2019
by
Tonghdj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add checkNotificationPermissionStatus
parent
20dfe5a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
android/src/main/java/com/baseflow/permissionhandler/PermissionHandlerPlugin.java
+10
-6
No files found.
android/src/main/java/com/baseflow/permissionhandler/PermissionHandlerPlugin.java
View file @
28bb7af0
...
@@ -260,12 +260,7 @@ public class PermissionHandlerPlugin implements MethodCallHandler {
...
@@ -260,12 +260,7 @@ public class PermissionHandlerPlugin implements MethodCallHandler {
}
}
if
(
permission
==
PERMISSION_GROUP_NOTIFICATION
)
{
if
(
permission
==
PERMISSION_GROUP_NOTIFICATION
)
{
NotificationManagerCompat
manager
=
NotificationManagerCompat
.
from
(
context
);
return
checkNotificationPermissionStatus
(
context
);
boolean
isGranted
=
manager
.
areNotificationsEnabled
();
if
(
isGranted
)
{
return
PERMISSION_STATUS_GRANTED
;
}
return
PERMISSION_STATUS_DENIED
;
}
}
final
List
<
String
>
names
=
getManifestNames
(
permission
);
final
List
<
String
>
names
=
getManifestNames
(
permission
);
...
@@ -739,4 +734,13 @@ public class PermissionHandlerPlugin implements MethodCallHandler {
...
@@ -739,4 +734,13 @@ public class PermissionHandlerPlugin implements MethodCallHandler {
return
!
TextUtils
.
isEmpty
(
locationProviders
);
return
!
TextUtils
.
isEmpty
(
locationProviders
);
}
}
}
}
private
int
checkNotificationPermissionStatus
(
Context
context
)
{
NotificationManagerCompat
manager
=
NotificationManagerCompat
.
from
(
context
);
boolean
isGranted
=
manager
.
areNotificationsEnabled
();
if
(
isGranted
)
{
return
PERMISSION_STATUS_GRANTED
;
}
return
PERMISSION_STATUS_DENIED
;
}
}
}
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