Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 231201

Local Notifications (Capacitor/React): Do not trigger on iOS

$
0
0

Welcome to the community!

Are you requesting permission first with requestPermissions?

Basically something like this:

if (await LocalNotifications.requestPermissions()).display === 'granted') {
  // continue with stuff
}

Do note that you only want to request permission once. After that, you use checkPermissions. The flow that I use is that once the user installs the app, I display a modal asking them to give permissions while explaining why they would want to.

Then on the screen where they can set notifications, I check if they granted permission. If they did, I let them continue. If they explicitly denied, I display a message saying that they didn’t grant permission and need to within the app settings in iOS in order to set a notification. if they didn’t accept or deny, then I show the request permission modal again (PermissionState = prompt).


Viewing all articles
Browse latest Browse all 231201

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>