iphone - App launched from the first screen from the foreground ios -
when pressing "home" button, app calling - (void)applicationwillresignactive:(uiapplication *)application
, ok good, when wait time (10-15 mins), app starting first loading screen, why? have added:
[uiapplication sharedapplication].idletimerdisabled = yes;
but not success. think goes suspended mode, how prevent this? thanks.
it means app has been killed system. can't prevent completely, system kills background apps when needs more memory, can this:
- free memory can when app goes in background: doing this, when system needs memory, app won't 1 of first killed because footprint low.
- since can't sure app won't killed, use state preservation / restoration: link
edit:
since app needs reproduce audio in background (as written in comments) give advices.
- remember register app background mode (from link: multitasking guide) --> "by including uibackgroundmodes key (with value audio) in info.plist file"
- the app continues work in background since it's playing audio, when audio suspended app suspended (it means can killed). so, must use state preservation restore when user comes back.
another extract: "when uibackgroundmodes key contains audio value, system’s media frameworks automatically prevent corresponding app being suspended when moves background. long playing audio or video content, app continues run in background. however, if app stops playing audio or video, system suspends it."
Comments
Post a Comment