0

I have an Expo app (which has been ejected but there is very little native code being used). I am using expo-notifications to schedule local notifications for the user. I am only doing this for background/killed state notifications. There are no foreground notifications.

I'd like to know if it's possible to turn them on or off when a button is pressed without losing all the notification data in React-native/Expo?

I want to add a toggle in the settings screen to turn notifications on or off and I can't figure out how to do this. I can of course cancel all scheduled notifications with cancelAllScheduledNotificationsAsync, but then if they toggle notifications back on all the existing ones would be lost.

I'm hoping to avoid having to store a bunch of data in AsyncStorage for this.

I'm working on handling this all in push notifications (which will solve a lot of headaches) but that's still a way out from being ready.

adrian
  • 2,786
  • 2
  • 18
  • 33

0 Answers0