NSMutableDictionary *songInfo = [[NSMutableDictionary alloc] init];
UIImage *image = [UIImage imageNamed:@"image2"];
MPMediaItemArtwork *albumArt = [[MPMediaItemArtwork alloc] initWithImage:image];
[songInfo setObject:@"Audio Title" forKey:MPMediaItemPropertyTitle];
songInfo setObject:@"Audio Author" forKey:MPMediaItemPropertyArtist];
[songInfo setObject:@"Audio Album" forKey:MPMediaItemPropertyAlbumTitle];
[songInfo setObject:albumArt forKey:MPMediaItemPropertyArtwork];
[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:songInfo];

user lock app screen

error log:

<Error>: CGImageCreate: invalid image size: 0 x 0.

1 Answers

0
seto nugroho On

add image extension in your UIImage *image = [UIImage imageNamed:@"image2"]; code.