ApplicationMusicPlayer's endSeeking() Fails to Stop Fast Forward - Seeking Solutions

I've encountered a critical issue while developing a music player app using SwiftUI and MusicKit. The problem persists across multiple devices and iOS versions, specifically with the endSeeking() method of ApplicationMusicPlayer, which fails to stop the fast-forward operation as expected.

Development Environment:

  • Xcode 16 Beta 6
  • macOS Sonoma 15.0 Beta 7 (24A5327a)

Affected Devices:

  • iPhone 11 Pro Max (iOS 17.6)
  • iPhone SE 3 (iOS 18.0 Beta 7)

Here's the relevant code snippet:

Image(systemName: "forward.end.circle")
    .foregroundStyle(.accent)
    .gesture(
        TapGesture()
            .onEnded { _ in
                vm.nextTrack()
            }
    )
    .simultaneousGesture(
        LongPressGesture(minimumDuration: 0.5)
            .onChanged { isPressing in
                if isPressing {
                    vm.player.beginSeekingForward()
                }
            }
            .onEnded { _ in
                vm.player.endSeeking()
            }
    )

The issue manifests when the long press ends: despite invoking the endSeeking() method, the fast-forward operation persists.

To troubleshoot, I've taken the following steps:

  1. Confirmed that vm.player is set to ApplicationMusicPlayer.shared.
  2. Attempted to combine endSeeking() with beginSeekingForward(), as per the documentation guidelines.

Despite these efforts, the problem persists across all tested devices and OS versions. This leads me to two critical questions:

  1. Has anyone else encountered a similar issue?
  2. Could this potentially be an undocumented bug in the latest MusicKit implementation?

Same happens when using systemMusicPlayer. Issue also seen when building with Xcode 15.4 as well as Xcode 16 Beta 6.

I tried my published music app and I see the issue there as well. Mind you I last updated the app a year ago and the SeekForward/SeekBackward/StopSeeking feature was working fine then.

So I think issue might have been introduced with recent iOS/iPadOS builds, not the SDKs.

The feature does not work with the following: iOS 18.1 Beta 3 iOS 18.0 Beta 8 iPadOS 17.6.1 iOS 17.4

But works with the following: iOS 17.0.3 iOS 16.7

The Apple Music app (which uses the systemMusicPlayer also) works fine with all builds, but that's because it uses private APIs, not the APIs our third party apps use.

Submitted: FB14997278

You may want to submit a ticket also to bring more attention to this.

Thank you @misen and @AntonGemini for submitting bug reports. Please use Feedback Assistant to track the status of your bug reports, and please keep testing on the latest betas to see if the issue has been resolved.

ApplicationMusicPlayer's endSeeking() Fails to Stop Fast Forward - Seeking Solutions
 
 
Q