On iOS, you can reply to text messages right from the push notification without opening the app. I want to do something similar in React Native, to have the user interact with a custom UI in a push notification without opening the app. At the moment I'm using react-native-onesignal, but I haven't found a way to get this functionality with OneSignal. Does anyone know how I can approach this?
Related
I am building a React Native app and would like to add weekly local notifications. The notifications should include dynamic data, such as a screen time increase, which will be calculated right before the notification is sent.
When the user enables the notifications by clicking "Enable Weekly Reports", the scheduleNotificationAsync method is called, taking the title parameter as input. However, the title will change over time.
What is the best way to periodically schedule notifications with dynamic content in React Native using the expo-notifications API?
Note: The BackgroundFetch method only works when the app is in the background, not if the app has been terminated or after a device reboot.
Related Questions:
React Native - Expo notification Scheduling
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.
A React Native-specific version of this question was asked, but not answered React-Native: How can I disable all push notifications while my app is active?
Essentially, is there a way to remove interruptions while my app is in the foreground? Ideally there would be a "focus" state I put the app into that minimizes disruptions, but I can't find an API like that.
Concretely, part of my app involves meditation states. Getting popups during one of those is distracting, so I'd like to disable banners and alerts while one of those sessions is running.
Happy to hear it's not possible, just haven't actually found that answer yet.
No, you don't have an API or control over other apps notifications. But surely you can control your app notifications. You can handle those notifications without prompting. Let me know if this is helpful.
There was a task to make push notifications when the application is completely off.
Need to implement some Background Task Manager that will be at intervals such as a minute to check for new notifications for a specific user. In simple words, make a background fetch.
Previously, I implemented push notifications in the application.But they work only when the application is enabled or simply minimized. When the app is completely off Push does not work.
Has anyone done this before ?
I use Expo for this project.
Part of our React Native App lets users use it in the background while they use other apps.
If the user then force quits the app while our app is in the background we want to do some cleanup and send some analytics. Since we can't get the applicationWillTerminate event in React Native we need to do this cleanup in the native side.
So we were wondering if there is a way to access the Redux store in this event. Or what is the suggested way to handle this?