This repository contains a demo project that illustrates a bug in ShazamKit's background operation on iOS 18. The issue causes ShazamKit to stop identifying songs after a period of time when the app is in the background.
On iOS 18, the ShazamKit framework stops working properly in the background after a short period (approximately 20 seconds). This issue does not occur on iOS 17 or earlier versions.
Specific behaviors:
- Music identification times out after a few seconds when the app is backgrounded or the device is locked.
- The app works fine when in the foreground.
- The microphone indicator remains on, suggesting the app still has microphone access.
- Run the app on an iOS 18 device.
- Start the song identification process.
- Send the app to the background.
- Play music near the device for a short period.
- Observe that after some time, new songs are no longer identified until the app is brought to the foreground.
- The app uses
SHManagedSessionfor continuous song matching. - Background modes are properly configured in Info.plist.
- The issue occurs even with audio background mode enabled.
This issue has been reported to Apple with the feedback number: FB15255903
- Xcode Version: Xcode 16.0
- iOS Version: 18.0 and 18.1
If you have any insights or potential solutions, please feel free to open an issue or submit a pull request.
For questions or further information, please open an issue in this repository.