Skip to content
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

FB15255903: ShazamKit stopped working in the background on iOS 18 #554

Open
tfmart opened this issue Sep 25, 2024 · 0 comments
Open

FB15255903: ShazamKit stopped working in the background on iOS 18 #554

tfmart opened this issue Sep 25, 2024 · 0 comments

Comments

@tfmart
Copy link

tfmart commented Sep 25, 2024

  • Date: 2024-09-24
  • Resolution: Open
  • Area: ShazamKit
  • OS: iOS 18.0 and 18.1
  • Type: Incorrect/Unexpected Behavior
  • Keywords:

Description

I’ve encountered an issue with ShazamKit in my iOS app on iOS 18. The app uses ShazamKit in the background to constantly identify songs and then proceeds to update a Live Activity with information of the latest recognized song. However, when running the app on iOS 18, I’ve observed the following behavior:

  • When running the app from Xcode, ShazamKit works as expected in the background, on both Debug and Release Configurations).
  • When running the app without being attached to Xcode (via TestFlight, App Store, or a debug build) on iOS 18, ShazamKit stops identifying songs after a certain period in the background.
  • The microphone indicator remains on, suggesting the app still has microphone access.
  • When bringing the app to the foreground, it immediately starts identifying songs again.
  • If the app remains in the foreground, it continues to identify songs without issues.
  • Importantly, this issue only occurs on iOS 18. The same app works fine on iOS 17 and earlier versions, continuing to identify songs in the background as expected.

Steps to Reproduce:

  1. Create an iOS app using ShazamKit with background audio capability.
  2. Implement a SHManagedSession to identify songs continuously.
  3. Set up a Live Activity to display the identified song.
  4. Run the app on a device with iOS 18 without attaching to Xcode (e.g., TestFlight or App Store version).
  5. Start the song identification process and send the app to the background.
  6. Play music near the device for a few seconds (~30 seconds)
  7. Observe that after some time, new songs are no longer identified until the app is brought to the foreground.
  8. Repeat the process on a device with iOS 17 or earlier to confirm the issue does not occur.

Expected Behavior:
ShazamKit should continue to identify songs in the background indefinitely on iOS 18, as it does on iOS 17 and earlier, as long as the app has the necessary background capabilities and permissions.

Actual Behavior:
On iOS 18, ShazamKit stops identifying new songs after a period of time in the background, despite the app still having microphone access. This does not occur on iOS 17 or earlier versions.

Files

ShazamKitBackground demo project on Github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant