ios - EAAccessory/EASession teardown during background -


using apple's eademo base i'm trying understand backgrounding's influence on eaaccessories.

when receive connectnotification, accessory, check protocol , streams. streams set delegate, schedule on runloop, , open

currently when go background tear down. out did , release objects.

i teardown on diddisconnect.

upon entry, don't didconnect walk connectedaccessory list , check appropriate devices.

-=-=-=-

the ea demo sets , tears down sessions on view don't see whether there background persistence.

the ea demo code seems suggest can tear down , go in long device hasn't disconnected.

the session , device seem state when ios device has slept or put app background , device stop acknowledging data or worse stop pulling data out of stream point stream fills up.


question: when using backgrounding, should not tear down session/accessory active unless diddisconnect notification. assume session , accessory structures (and maybe streams) survive in background?

my experience external accessory framework poorly designed initially, in terms of robustness. until ios 4.0, trying connect multiple accessories yield error message:

cannot use accessory. 1 accessory can in use @ time. 

now seems there has not been attention happens accessories when apps go background. have been assured correct behavior easession instances released on accessory disconnect. don't think app going background qualifies accessory being disconnected. there isn't go if log value of connectedid accessories, notice not change having switched background , foreground. suspect list of connected eaaccessory instances not refreshed unless eaaccessorymanager notified of change (connect/disconnect) of accessory.

i have been trying teardown , recreate easession instances , has failed. going try leaving easession in place throughout background/foreground transition. 1 concern app won't receiving eaaccessorydiddisconnectnotification , eaaccessorydidconnectnotification notifications while in background.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -