Show some UI from background in audio player or VOIP app on iOS

Deadly 提交于 2019-11-30 09:25:24

问题


I know that audio players and Voip apps can run in background on iOS.

Is there a way to show UI from background (except LocalNotifications)? I mean full screen UI.

A method which uses private API or other tricks are acceptable. The application will be signed with enterprise certificate and won't be deployed/reviewed by AppStore.

A method which works only on jailbroken iOS device isn't acceptable.


回答1:


Check out this document and search for "Implementing Long-Running Background Tasks" Basically you need to register your app to run in the background instead of being suspended and listen for notifications.

from the docs: " An app declares support for a service using its Info.plist file. Add the UIBackgroundModes key to your Info.plist file" and ".....values lets the system know that your app should be woken up at appropriate times to respond to relevant events."

http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4-SW20




回答2:


Victor, have you tried some trick like defining a custom URL for your App?

Springboard can start applications when parsing custom URLs; if they are in background they become foreground.

You must create a URL type into your app's info.plist in the key CFBundleURLTypes, for example "mySpecialURLType". Your application delegate also have to implement handleOpenURL: and openURL:sourceApplication:annotation:.

If you (in your background task) ask for a URL like "mySpecialURLType://", theoretically SpringBoard will start your application.

I don't know if it works, but is worth a try...

Best!




回答3:


Just create a front end UI application and have it interact with the backend. I'm no pro on iOS development, but this is how I interact with background services in Android and Windows applications. Unless of course I'm completely missing what you are trying to do.



来源:https://stackoverflow.com/questions/11531544/show-some-ui-from-background-in-audio-player-or-voip-app-on-ios

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