Programmatically changing the iOS lock-screen
Asked Answered
L

1

18

I'm building an app which would have to have the ability to show my own views on the iPhone lock screen. I've seen lots of apps which let you customize the lockscreen and so forth and these were App Store apps so i'm guessing it has to possible.

I just can't figure out what to use in the iOS SDK to even try implementing this.

Oh and P.S: same goes for wallpapers—can we change this from inside our app?

Lemire answered 5/6, 2011 at 14:42 Comment(5)
You've seen an app that lets you customise the lock screen in Apple's app store? Really?Chervil
There are some apps that will create images which the user can then set as the lockscreen background. For example a notes app will let the user enter text, and select a background, then overlay the note onto the background and save the result to the photo library, then tell the user to open the settings app and set the background to the saved image. This is more of a hack than anything useful as the "notes" can't be automatically changed.Stonefish
@Jonathan - I get you. (Was coming at it from the "setting the wallpaper != customisation" perspective.) :-)Chervil
@middapark, I know, I was aiming the comment at the OP. :)Stonefish
There is a well known app on the AppStore that changes the lockscreen wallpaper but only while it is running in the foreground. It's "Ambiance". If you play a file with it it apparently exploits the media display feature Norbert May mentions below.Overspend
G
19

It can be changed programmatically (change to SpringBoard), but it won't make the way to the (official) AppStore. So if you want to build an app that can change something like the lock screen wallpaper or the ring tone which you usually need the Settings app for, you have to publish your application via Cydia, not Apple's store.

For a sample code block, see this answer.

Geodynamics answered 5/6, 2011 at 15:2 Comment(6)
quick reply thank you very much. Too bad though, just out of curiosity how is it then that the Remind Me app in the appstore does what is apparently not permitted by appleLemire
It just generates a picture and needs you (the user) to set it as the wallpaper. Not very user friendly...Geodynamics
Music/audio apps such as Spotify and Soundcloud set the currently playing album art for the lock screen. Is audio player artwork perhaps a special allowed case by Apple? Or maybe they let certain 'big' apps/companies get away with it?Volplane
Take a look at the MPNowPlayingInfoCenter class.Geodynamics
I would like to say this is false. I have seen many apps that can change the lock screen image without the user needing to do anything. I have seen everything from animated 3D scenes to video players. These apps are all over the official AppStore.Viperine
@Justin: This is not possible without jailbreaking except you're creating an audio playing app having album artwork (displayed while playing sound).Geodynamics

© 2022 - 2024 — McMap. All rights reserved.