You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the request
I have a use case for background notification actions, which triggers some changes in the data store of the application. The action itself should be a background action, since I don't want it to open the UI if the application is closed.
The issue is, if the application is running, and user picks these actions while the application is on the foreground, the UI of my application cannot get refreshed since the main isolate cannot know if the data store is changed or not.
As far as I could read, the recommended approach is to pass SendPort to the created isolate but the onDidReceiveBackgroundNotificationResponse method doesn't allow for such a change.
My question is, if it is possible to create a communication link between background isolate that is triggered by a notification action and the main isolate, if it exists.
If it is not something possible, please consder my message and use case as a feature request for users of the app to be able to create such communication channels.
To Reproduce
Have an application storing state in a persistent store, and showing that information on UI
Register a notification with a background action. This action triggers the state in the persistent store to change.
While the app is open, trigger the action of your notification and observe that the state in the persistent store changes while the UI stays the same since the application hasn't been notified about the change in the persistent store(sinceaction and main isolates are seperate, there is no way visible to me to notify the main isolate as of now)
Expected behavior
If it is possible to create a communication channel between background isolate and main isolate, the documentation to explain how.
Making it possible to create of such a communication channel
The text was updated successfully, but these errors were encountered:
I have been able to read a bit more on the isolates and was able to communicate between two of the isolates(the main isolate and the isolate spawned by the background action) using flutter's IsolateNameServer. I can either close this issue, or ask your idea about adding that detail to the documentation. If you wish, I can also add a small mention to IsolateNameServer to the documentation as a contribution.
Hi, thanks for bringing this up! I'm in the process of re-shaping the plugin's documentation. This was on my list but hasn't been added yet. You can keep up with my (slow) progress at #2477
Describe the request
I have a use case for background notification actions, which triggers some changes in the data store of the application. The action itself should be a background action, since I don't want it to open the UI if the application is closed.
The issue is, if the application is running, and user picks these actions while the application is on the foreground, the UI of my application cannot get refreshed since the main isolate cannot know if the data store is changed or not.
As far as I could read, the recommended approach is to pass SendPort to the created isolate but the
onDidReceiveBackgroundNotificationResponse
method doesn't allow for such a change.My question is, if it is possible to create a communication link between background isolate that is triggered by a notification action and the main isolate, if it exists.
If it is not something possible, please consder my message and use case as a feature request for users of the app to be able to create such communication channels.
To Reproduce
Expected behavior
The text was updated successfully, but these errors were encountered: