Curious to know the trick for live wallpapers on lock screen on iPhone
Asked Answered
O

2

6

This application and this application says it displays live wallpapers on lock screen. We have similar requirement.

From reviews came to know that it is playing music in background with silent volume, but it is not relevant to setting wallpapers.

Totally bummer topic for us. Can anyone please suggest some point where to begin.. ?

Referred this and Referred this questions on our forum, but says that it won't be approved by Apple. So how does current application exist on store ?

Note: Please consider this as genuine programming questions as there is no starting point we can find.

Oddity answered 6/2, 2012 at 6:58 Comment(0)
T
4

If you play music, you can use MPNowPlayingInfoCenter (Available in iOS 5.0 and later.) to set things like cover art, title and artist on the lock screen. Your code could look like this:

NSMutableDictionary *currentTrackData = [[NSMutableDictionary alloc] init];
[currentTrackData setObject:"Some text" forKey:MPMediaItemPropertyTitle];

MPMediaItemArtwork *mediaItemArtwork =[[MPMediaItemArtwork alloc] initWithImage:[UIImage imageNamed:@"your image path"]];
[currentTrackData setObject:mediaItemArtwork forKey:MPMediaItemPropertyArtwork];
[mediaItemArtwork release];

[MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo = currentTrackData;

Dont forget to import the media player framework:

#import <MediaPlayer/MediaPlayer.h>
Tonl answered 6/2, 2012 at 8:33 Comment(0)
B
0

The live lockscreen app must be doing it this way (MPNowPlayingInfoCenter) as you cant play music whilst using the app

Boeschen answered 11/5, 2012 at 10:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.