Add image on lock screen in iOS app, when app is running in background

走远了吗. 提交于 2019-11-30 18:07:43

问题


There are many question on site like

Programatically changing the iOS lock-screen ,

How to set lock screen , wallpaper and Ringtone programmatically in iPhone? All say that apple will reject if we modify the lock-Screen image.

But I seen it in many apps. Example Saavn is in AppStore.

In this if a song is playing and device is locked, It shows the image of the current album on the lock screen.

Please share if anybody know how it can be done. Thanks.


回答1:


Music apps can change the lock screen wallpaper because iOS automatically displays the album artwork for the song/podcast/etc that's playing (see MPMusicPlayerController docs). As far as I know, it's not an API that's publicly available to developers.




回答2:


The "podcaster" app (3rd party not apple) displays an image of the currently playing podcast. Podcast images are stored in the RSS feed and not in each mp3 so the app is dynamically telling the os which image goes with with mp3. Of course you can play "silence" out of the speaker but I don't think this is a clean solution



来源:https://stackoverflow.com/questions/15024361/add-image-on-lock-screen-in-ios-app-when-app-is-running-in-background

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!