-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue using Sembast in Background Notification - Android #356
Comments
Unfortunately I don't have a good solution. sembast is definitely not safe in background isolate. I would personally use a separate solution for the notification:
|
Unfortunately, creating a second table and reading from there when the app returns to the foreground doesn't work; I'll try another solution and leave my answer here. When you said read mode, is it something special? |
@jamescardona11 did you find any solution for that? I have the same problem |
@x3rud no directly with Sembast; I made a mix following the suggestion from Alex about writing in a temporal file and read/write when the app is open again. |
Thank you. The strange thing is that the data is being stored on the database. @alextekartik have you thought about a hypothetical solution in recent months? |
The issue is that since every isolate has its own copy in memory content might be different with what is store in the database. I don't have a good solution for this unfortunately...sorry. |
Hello, I hope everything is going well.
I have a question; I have a Sembast instance in foreground state to watch all information from the database.
When I change the app background state and receive a notification from Firebase, I save some data in Sembast, I saw in the documentation Firebase Background Notification works like an Isolate.
The data is saved to Sembast with that, but the main app can't emit that new data received from the notification background.
If I continue sending information in foreground, the main isolate is emitted data from Sembast.
When I do a HotReload, the data from background is emitted.
I want to drop a video to show the behavior that only happens in Android.
I tried to stop and restart the subscription in the main Isolate, and is not emitting data that is received from the notification background.
Screen.Recording.2023-04-21.at.4.43.14.PM.mp4
The text was updated successfully, but these errors were encountered: