Search code examples
iosactionscript-3mobileairbackground-process

Air / As3 / iOS - Accelerometer data in background. Is it possible?


Is it possible to receive accelerometer data in background with AIR? (similar to Nike+ on iOS)

I read that it's possible with Objective-C if we use "Core Motion Framework" and "UIBackgroundModes=location". What about Air?

Thank you


Solution

  • From what I've seen it appears my application goes completely idle when you navigate away to another application/screen. From what I'm reading here it doesn't appear to be possible to keep getting info about the accelerometer.

    http://blogs.adobe.com/airodynamics/2012/05/04/air-ios-background-behavior/

    Hmm k did a bit more digging around to verify if you could do this with a native extension assuming the built in Accelerometer class doesn't provide the necessary functionality. Apparently the Core Motion framework way of accessing the Accelerometer does allow it to continue to be "polled" in the background: How Nike+ GPS on iPhone receives accelerometer updates in the background?

    Since I own exactly 0 iOS devices I can't really test this one for you but would be interested to hear how it works out, best of luck.