|
@@ -22,6 +22,7 @@ import com.facebook.react.modules.permissions.PermissionsModule;
|
22
|
22
|
public class ReactNativePermissionsModule extends ReactContextBaseJavaModule {
|
23
|
23
|
private final ReactApplicationContext reactContext;
|
24
|
24
|
private final PermissionsModule mPermissionsModule;
|
|
25
|
+ private final NotificationManagerCompat mNotificationManagerCompat;
|
25
|
26
|
|
26
|
27
|
public enum RNType {
|
27
|
28
|
LOCATION,
|
|
@@ -37,7 +38,7 @@ public class ReactNativePermissionsModule extends ReactContextBaseJavaModule {
|
37
|
38
|
super(reactContext);
|
38
|
39
|
this.reactContext = reactContext;
|
39
|
40
|
mPermissionsModule = new PermissionsModule(this.reactContext);
|
40
|
|
- this.notificationManagerCompat = NotificationManagerCompat.from(reactContext);
|
|
41
|
+ mNotificationManagerCompat = NotificationManagerCompat.from(this.reactContext);
|
41
|
42
|
}
|
42
|
43
|
|
43
|
44
|
@Override
|
|
@@ -55,8 +56,8 @@ public class ReactNativePermissionsModule extends ReactContextBaseJavaModule {
|
55
|
56
|
return;
|
56
|
57
|
}
|
57
|
58
|
|
58
|
|
- if(permission == 'notification') {
|
59
|
|
- if (this.notificationManagerCompat.areNotificationsEnabled()) {
|
|
59
|
+ if(permission.equals('notification')) {
|
|
60
|
+ if (mNotificationManagerCompat.areNotificationsEnabled()) {
|
60
|
61
|
promise.resolve("authorized");
|
61
|
62
|
} else {
|
62
|
63
|
promise.resolve("denied");
|