ryanheise / audio_service

Flutter plugin to play audio in the background while the screen is off.
803 stars 480 forks source link

Play/Pause button on iOS 16.1 lock screen is not visible #979

Closed EthanBarlow closed 1 year ago

EthanBarlow commented 1 year ago

Documented behaviour

The list of currently enabled controls which should be shown in the media notification. Each control represents a clickable button with a MediaAction that must be one of:

Actual behaviour

The play/pause button is not visibly shown in the media notification.

Minimal reproduction project

Official example: main.dart

Reproduction steps

  1. Tap on the play button.
  2. Swipe down from the top of the iOS screen.
  3. Observe the media controls (fast forward and rewind are visible and functional)
  4. Tap where the play/pause button should be and notice that playback is affected, yet the button is not visible.

    Output of flutter doctor

    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    [✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 2021.2)
    [✓] VS Code (version 1.69.2)
    [✓] Connected device (3 available)
    [✓] HTTP Host Availability

• No issues found!```

Devices exhibiting the bug

Development machine - MacBook Pro, Apple M1 Pro, macOS Ventura 13.0.1 (22A400) Building for iOS simulator - iPhone 14 Pro on iOS 16.1

EthanBarlow commented 1 year ago

@ryanheise I am happy to look into this more, but I'm unfamiliar with native iOS so I got lost when trying to debug. Do you have any tips or ideas where I might start my search?

ryanheise commented 1 year ago

Thanks for taking an interest in contributing! These sorts of things typically come down to reviewing the Apple documentation for the APIs being used and checking in stack overflow for similar issues in native iOS apps.

virmana commented 1 year ago

The same issue here .

EthanBarlow commented 1 year ago

@virmana Have you observed this issue on both the simulator and a physical iPhone?

virmana commented 1 year ago

@EthanBarlow I just tested the app on simulator, does it work well in physical iPhone?

EthanBarlow commented 1 year ago

@virmana I do not have a physical iPhone that can run the latest version of iOS. I am currently stuck with an iPhone 6s that runs iOS 15.7.2

leonidlist commented 1 year ago

Just tested this behaviour on physical iPhone with iOS 16.2 installed and everything works as expected

ryanheise commented 1 year ago

Thanks for testing, @leonidlist .

@EthanBarlow can you get a beta tester to test your app on their physical phone through TestFlight?

virmana commented 1 year ago

Thank you @leonidlist .

leonidlist commented 1 year ago

So as I see it is mainly related to emulator, because on emulator (iOS 16.1) I don't see action buttons on lock screen/dynamic island @EthanBarlow @virmana

EthanBarlow commented 1 year ago

@ryanheise I will work on getting a beta tester to check this behavior, and I am expecting to get a new device that will support the latest OS allowing me to perform the test myself. @leonidlist Thank you for testing! Also, I will update my Xcode installation and test on the simulator with iOS 16.2 since right now I am on iOS 16.1.

EthanBarlow commented 1 year ago

I just set up an iPhone 11 running iOS 16.2 and found that the bug described is not occurring on a physical device. It appears to be a problem with the iOS simulators. Thank you @virmana, @leonidlist, and @ryanheise for your input. I will close this issue since it's not actually a problem on physical devices running the latest iOS (16.2 at the time of posting).

github-actions[bot] commented 1 year ago

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.