React Native Music control not showing album art on lock screen iOS Real Device

Viewed 131

I am trying to add an artwork to the media that is being played when our app is playing, we only use one artwork for all of our playing times for the meantime since it's a radio app.

The following code is used to display an icon, it works on simulator but it doesn't seem to work on a real device.

We are using a webview with a stream as a player and visualizer.

Description I have followed the instructions for both iOS and Android and the controls work perfectly fine, I have added the capabilities needed for this package to run on the iOS Side

Code Used:

import MusicControl, { Command } from 'react-native-music-control';

const logo = 'https://i.imgur.com/e1cpwdo.png';

  componentDidMount() {
    MusicControl.enableBackgroundMode(true);
    MusicControl.handleAudioInterruptions(true);

    MusicControl.on(Command.play, () => {
      this.toggleAudio();
    })

}

  toggleAudio = () => {
    if (!this.state.isInitialized) {
      MusicControl.setNowPlaying({
        title: 'Belight FM',
        artwork: logo, // URL or RN's image require()
        artist: '105.7',
        color: 0xffffff, 
        colorized: true, 
        isLiveStream: true,
        elapsedTime: 0,
      })
      MusicControl.enableControl('play', true)
      MusicControl.enableControl('pause', true)
      MusicControl.enableControl('skipBackward', true, { interval: 10 })
      MusicControl.enableControl('skipForward', true, { interval: 10 })
      this.setState(prevState => ({
        isInitialized: !prevState.isInitialized
      }));
    }
0 Answers
Related