Created
November 16, 2016 11:54
-
-
Save bhrott/0e53b36eef3dafcd8a9e3cfa4e08ac4c to your computer and use it in GitHub Desktop.
React Native : Android : Check notification is enabled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ReactMethod | |
public void areNotificationsEnabled(Promise promise) { | |
try { | |
Boolean areEnabled = NotificationManagerCompat.from(getReactApplicationContext()).areNotificationsEnabled(); | |
promise.resolve(areEnabled); | |
}catch (Exception e) { | |
promise.reject(e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment