Show some UI from background in audio player or VO

2019-01-28 09:39发布

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.

3条回答
家丑人穷心不美
2楼-- · 2019-01-28 10:02

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楼-- · 2019-01-28 10:07

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.

查看更多
干净又极端
4楼-- · 2019-01-28 10:09

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

查看更多
登录 后发表回答