[question]: How can I capture OneSignal notification data when the app is closed (killed state)?
Hello I want to capture data and save Hive. When app work and I get notification it work with OneSignal.Notifications.addForegroundWillDisplayListener. But I want to capture data when app closoed and I get data I want to save it to hive I am using Flutter with OneSignal for push notifications. When the app is running (foreground), I can capture notification data using: OneSignal.Notifications.addForegroundWillDisplayListener However, I need to capture notification data even when the app is completely closed (killed state) and save it to Hive. I want to • Receive OneSignal notifications when the app is closed. • Capture notification data (additionalData, collapseKey, etc.). • Save this data to Hive for later use.
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
any update on this?
find any solution, how to capture background data when app is in killed state
any update on this?
find any solution, how to capture background data when app is in killed state
(https://documentation.onesignal.com/docs/service-extensions) In here there is a way but I didn't implement yet.
any update on this? find any solution, how to capture background data when app is in killed state
(https://documentation.onesignal.com/docs/service-extensions) In here there is a way but I didn't implement yet.
I implement this and one more thing
//public fuction
@pragma("vm:entry-point")
Future
OneSignal.Notifications.addForegroundWillDisplayListener((event) { showNotifications(event); debugPrint("[OneSignal] Foreground Notification: "); });
Now i am getting notfications but when i click on notification its not opening the app
any update on this? find any solution, how to capture background data when app is in killed state
(https://documentation.onesignal.com/docs/service-extensions) In here there is a way but I didn't implement yet.
I implement this and one more thing
//public fuction @pragma("vm:entry-point") Future showNotifications(result) async { }
OneSignal.Notifications.addForegroundWillDisplayListener((event) { showNotifications(event); debugPrint("[OneSignal] Foreground Notification: "); });
Now i am getting notfications but when i click on notification its not opening the app
Do you have any sample code to refer this