'Flutter: Phone call and background audio management
In my Flutter project I added the function that when you receive a phone call the app’s audio music pauses, and when the call ends, it resume.
When the app is not in the background there are no problems in both iOS and Android. When the app is in the background when the call comes some problem occurs then.
With Android this also works when the app is in the background (before the phone call arrives), but with iOS I can't automatically restart it.
Even using didChangeAppLifecycleState with iOS when it is paused it is not possible to restart the audio (to my knowledge).
In Android, however, when it is in the background (always before the phone call arrives) it restarts, but I can't pause it so that when the phone call ends it restarts from the exact point where it stopped.
I thought that through “audio_system", you can control the audio in the background.
So, I ask you if there is the possibility to control the audio even in the background so that it can restart it with iOS or pause it with Android. I hope I was clear.
The problem for iOS is that I can't find a way to make it react when it's in paused mode. setState does not work and so do other commands. It's like hibernated.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
