Checking Notification Permissions Android not working
See original GitHub issueChecking Notification Permissions Android not working
I’m trying to get the Android App Notification status with the check permission method here. Here’s the code to check permission in Android
According the readme file, I did the following…
yarn add react-native-push-notification
- I have not performed any manual installation as stated here
- I write my code as below
- Android has no respond, but iOS did come back with expected respond.
import PushNotification from 'react-native-push-notification';
async componentDidMount(){
PushNotification.checkPermission().then((response) => {
if (response && response.alert !== 0) {
console.log('hi4')
console.log(response)
return;
}
console.log('hi5')
console.log(response)
});
}
Am I doing anything wrong here to check the App Notification status in Android?
For iOS, I have this install.
yarn add @react-native-community/push-notification-ios
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
android - How to check if my app is allowed to show notification
I tested this by manually changing the notifications permissions in settings and it worked fine, boolean was returned correctly in both cases.
Read more >Notification runtime permission - Android Developers
Best practices · Update your app's target SDK version · Wait to show notification permission prompt · Request the permission in context ·...
Read more >Change app permissions on your Android phone - Google Help
An app will send a notification to ask for permission to use features on your phone, which you can ... Some of these...
Read more >Top Tips for Adopting Android's Notification Permission
You can check by first calling the NotificationManager#areNotificationsEnabled() API. After the user upgrades their device to Android 13, the API reflects the ...
Read more >Android is finally gonna ask you about notifs before bugging ...
Android 13 is bringing a new run time notification permission. ... but essential component of how notifications work — and I hope I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/zo0r/react-native-push-notification#checking-notification-permissions
PushNotification.checkPermissions(callback: Function)
Check permissionscallback
will be invoked with apermissions
object:alert
: booleanbadge
: booleansound
: booleanThanks @Dallas62, finally I get you now. 🙏🏻