Laerdal / Xamarin.AzureCommunicationCalling

Xamarin iOS and Android binding libraries for Microsofts Azure Communication Services
MIT License
36 stars 11 forks source link

Android screen freezes when other user hangs up #11

Closed bigbbri closed 3 years ago

bigbbri commented 3 years ago

Hi, we have iOS side working well but need your advice on the Android side. We have a scenario that is failing in our Android app side, we have a user connected to a video/conf call via our website and we have an Android user connected to the same call. If the web user hangs up (ending the call) the Android user's screen freezes. We know we can see the disconnect in the VideoStreamsUpdated event, we see the RemoteParticipant disconnecting. What we don't know how to do is raise an even from CallingManager in our Droid project so we can post a message that the user ended the call and then navigate away from the page back to their appointment page.

We tried this (we use Prism) but it's like the hangup doesn't kill off all the resources to still being bound as the page doesn't navigate away. var ea = PrismApplicationBase.Current.Container.Resolve(); ea.GetEvent().Publish(true);

Do you all have an example of the call ending from another (external to the app) user and how to gracefully handle the shutdown of the call and nav away?

Thanks for all your so far and on this, we appreciate it, Brian

tompi commented 3 years ago

Hi Brian!

The "CallingManager" in the testapp is just a minimal abstraction over ACS on iOS and android, its in no way complete, and I dont have the time to make anything like that ;-) Ideally, we should maybe steal the javascript interface code that in c#(as interfaces/enums ets) and then implement these in iOS and Android. But this is quite some work, and unfortunately out of my scope.

Anyway, your problem might seem to be more of a prism/navigation issue? Maybe check the result of the navigation method, is it successful? Are you calling it on the main thread? Also, I would NOT use global events for this kind of thing, just add events to the calling manager, and do your navigation in the viewmodel. (your event should probably be triggered in _call_RemoteParticipantsUpdated on android, in which I currently ONLY use e.P0.AddedParticipants, but you need to use the e.P0.RemovedParticipants)

tompi commented 3 years ago

Closing due to inactivity

SeadnaS commented 3 years ago

Was this ever solved? I am having a similar issue however it happens on android side when it hangs up itself (not from other side)