简体   繁体   English

当应用程序在后台运行时,在iOS应用程序的锁定屏幕上添加图像

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

There are many question on site like 网站上有很多问题

Programatically changing the iOS lock-screen , 以编程方式更改iOS锁定屏幕

How to set lock screen , wallpaper and Ringtone programmatically in iPhone? 如何在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. 示例Saavn在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. 谢谢。

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 ). 音乐应用可以更改锁定屏幕壁纸,因为iOS会自动显示正在播放的歌曲/播客/等的专辑插图(请参阅MPMusicPlayerController 文档 )。 As far as I know, it's not an API that's publicly available to developers. 据我所知,这不是开发人员公开可用的API。

The "podcaster" app (3rd party not apple) displays an image of the currently playing podcast. “podcaster”应用程序(第三方不是苹果)显示当前正在播放的播客的图像。 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. 播客图像存储在RSS源中,而不是存储在每个mp3中,因此应用程序动态地告诉操作系统哪个图像与mp3一起使用。 Of course you can play "silence" out of the speaker but I don't think this is a clean solution 当然你可以在扬声器中播放“沉默”,但我不认为这是一个干净的解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM