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
I am using firebase_messaging plugin for voip in my Android app. Presently I am getting both foreground and background notifications. In foreground notifications my app is working fine and I am able to initiate a call and integrate it with WebRtc. But when I get a background notification I am not able to initiate a call as all my variables of the app are null in the background notification. This is because a new isolate is spawned in a background notification. Also in this link it is said that
Since the handler runs in its own isolate outside your applications context, it is not possible to update application state or execute any UI impacting logic. You can, however, perform logic such as HTTP requests, perform IO operations (e.g. updating local storage), communicate with other plugins etc.
So we cannot do anything with that notification. In almost all of the example projects using this plugin I see only print statement in the backgroundHandler. I would like to initiate a call and when the call is accepted start a WebRtc interface. All this is working in the foreground notification. I would like to know how to communicate with the foreground isolate when I get a background notification. Also how to bring the app to foreground for Android 10 and above. In Android 9 we can bring the app to foreground but not in Android 10.
I am not sure what to do after receiving the background notification. Please help me in creating a voip app for Android using Flutter.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am using firebase_messaging plugin for voip in my Android app. Presently I am getting both foreground and background notifications. In foreground notifications my app is working fine and I am able to initiate a call and integrate it with WebRtc. But when I get a background notification I am not able to initiate a call as all my variables of the app are null in the background notification. This is because a new isolate is spawned in a background notification. Also in this link it is said that
Since the handler runs in its own isolate outside your applications context, it is not possible to update application state or execute any UI impacting logic. You can, however, perform logic such as HTTP requests, perform IO operations (e.g. updating local storage), communicate with other plugins etc.
So we cannot do anything with that notification. In almost all of the example projects using this plugin I see only print statement in the backgroundHandler. I would like to initiate a call and when the call is accepted start a WebRtc interface. All this is working in the foreground notification. I would like to know how to communicate with the foreground isolate when I get a background notification. Also how to bring the app to foreground for Android 10 and above. In Android 9 we can bring the app to foreground but not in Android 10.
I am not sure what to do after receiving the background notification. Please help me in creating a voip app for Android using Flutter.
Beta Was this translation helpful? Give feedback.
All reactions