-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
iOS simulator - player on lock screen/notifications slow to appear #301
Comments
Hi @Drabuna , to help me to investigate this bug more easily, would you be able to fill in the bug report template? Make sure all fields are supplied where applicable, and in particular the minimal reproduction project (if not the example project). |
@ryanheise Sorry, wasn't sure if it should be considered a bug. I've now edited the initial question to cover the template. |
Thanks for the report, @Drabuna . I have a somewhat limited testing environment (simulator via MacInCloud) which lets me test up to iOS 13.3, and like you I don't have a physical device. Perhaps someone else would be able to confirm the delay you observed. I did however try the iOS 13.3 simulator and tried pulling down from the top left corner. I didn't notice any difference pulling down from there and the top centre, or top right, in all cases I saw an empty notifications area. What simulated iPhone model did you test with? |
I've tested with simulated iPhone 11, 11 pro and max. |
I've discovered a workaround - not sure why this works the way it does, but anyway. So, just create:
Note that if Also note that trying to call same And invoke it somewhere in the app below
After this is done, you should be able to start your normal audio isolate task, and it will work as it should, and the notification center will display the player immediately. This doesn't fix the buttons being out of sync with the app state though. @ryanheise Grab the modified example here if you want to try it out main.dart.txt |
That is very interesting. I'd like to understand what's going on here, but sadly I have been unable to reproduce it. When I get a chance, I'll try simulating an iPhone 11. |
I got to test it out on a real device, and none of the issues I mentioned are present. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with audio_service. |
Describe the bug
After tapping play (which will play an audio file via audio_service) swipe down from the left top-corner to see the notification screen on iOS Simulator. I expect to see the iOS audio player there, but it doesn't appear. It will take sometime for it to appear, sometimes you have to trigger pause/stop states. I am calling
AudioServiceBackground.setState(...)
onStart, onPlay and so on.Another thing is that most of the times when player appears, it seems to be out-of-sync with audio_service. Say I want to show "pause" button when audio is playing and "play" button when audio is paused. In most cases Simulator will just show "play" button (even if it's completely commented out in my code).
That being said, I can see that MediaItems are updating correctly and swiftly.
Running the same application on Android Emulator, I can see that all the states and buttons are updated correctly and in time, and "audio-player notification" appears immediately.
Minimal reproduction project
I haven't tested this on a real device, but I tried this both on the application that I'm building and on the example project for audio_service.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
An audio player should appear in the notification center as soon as I open it, given that the
setState
was called before that and audio is playingScreenshots
Video demo
Runtime Environment (please complete the following information if relevant):
Simulator
Version 11.4.1 (921.9)
SimulatorKit 581.9.1
CoreSimulator 704.12.1
Simulator iOs version
ios 13.4
Flutter SDK version
Additional context
I'm using audio_service with just_audio.
Is it just Simulator implementation of the notification center or something else?
Have anyone else experienced that? Will it work faster on real device?
The text was updated successfully, but these errors were encountered: