question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add requestPermissions() for push notifications / Local Notifications

See original GitHub issue

I’d like to be able to check if the user has granted permission for notifications. This way we tell them to change it in their settings, etc.

Proposed methods LocalNotifications.checkPermissions() or App.checkPermissions() (returns object of entire app permissions)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jcesarmobilecommented, Oct 10, 2018

I went with LocalNotifications.areEnabled(), as it’s not really a permission and the name is closer to the native one.

const areEnabled = await LocalNotifications.areEnabled();
console.log('are notifications enabled?', areEnabled.value);
1reaction
jcesarmobilecommented, Jan 8, 2021

No, on Android there are no permissions for notifications. If they are disabled, they are disabled, but there is no way for requesting the permission that doesn’t exist, you’ll have to continue prompting with a custom message to tell the users to enabled them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Asking Permission to Use Notifications - Apple Developer
Request permission to display alerts, play sounds, or badge the app's icon in response to a notification.
Read more >
Notification runtime permission - Android Developers
To request the new notification permission from your app, update your app to target Android 13 and complete a similar process compared to...
Read more >
Local Notifications | CodePath iOS Cliffnotes
Step 1: Request Permissions. Add the code below to request permission to send the user notifications. For testing, you can add it in...
Read more >
Ask permission for push notification - android - Stack Overflow
I'm working an application and I need to use push notification. I know that push notification are a normal ...
Read more >
Notification.requestPermission() - Web APIs - MDN Web Docs
The requestPermission() method of the Notification interface requests permission from the user for the current origin to display ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found