react-native-track-player: [iOS] Artwork not showing on lock screen
Configuration
React Native Environment Info: System: OS: macOS 10.14.3 Binaries: Node: 10.12.0 - /usr/local/bin/node Yarn: 1.9.4 - /usr/local/bin/yarn npm: 6.4.1 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.2 Android SDK: API Levels: 23, 26, 27, 28 Build Tools: 28.0.3 System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom npmPackages: react: 16.8.3 => 16.8.3 react-native: ^0.59.4 => 0.59.4
React Native Track Player - v1.1.4
Issue
The artwork for the tracks is not showing up on the lock screen on iOS, on Android everything is fine. On iOS, instead of showing the correct artwork it shows the app icon instead.
Code
I am adding tracks like this
TrackPlayer.add({ id: value.name, url: value.url, title: value.name, artist: value.artist, artwork: value.artwork });
The artwork field is:
artwork: require('App/assets/x.jpg')
The artwork is showing fine within the app but never works on the lock screen.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 16 (7 by maintainers)
Commits related to this issue
- [iOS] Artwork not showing on lock screen #562 — committed to nishanBende/react-native-track-player by intergalacticspacehighway 4 years ago
- [iOS] Fix local images not loading on lock screen. #562 (#897) * [iOS] Artwork not showing on lock screen #562 * Issue 562 - use MediaURL's isLocal Co-authored-by: Sunny-Nishan <nishanbende@gma... — committed to doublesymmetry/react-native-track-player by nishanBende 4 years ago
- Merge branch 'dev' of github.com:react-native-kit/react-native-track-player into bugfix/ios-events * 'dev' of github.com:react-native-kit/react-native-track-player: [iOS] Simplify Podfile [iOS] R... — committed to curiousdustin/react-native-track-player by curiousdustin 4 years ago
Thanks! 🥇
I was able to reproduce the issue using the 2 ways of declaring a local file path mentioned in the docs.
In both of these cases the images fail to load in iOS lock screen controls.
In both cases, https://github.com/react-native-kit/react-native-track-player/pull/897 resolves the issue.