Copy link to clipboard
Copied
Hi All
I cannot find some coherent information on this so I am asking here.
I need to write an iOS app that needs to perform a webservice call every x minutes to update the slqite db on the device, even if the application is not running in the foreground.
From google what I could find out was that iOS will only allow your app to run a small time after closing(to finish an upload etc).
e.g. "AIR does not provide support for this iOS background processing model": http://www.adobe.com/devnet/air/articles/considerations-air-apps-mobile.html#articlecontentAdobe_num...
but then later " applications may now support location updates and networking in the background": http://forums.adobe.com/message/4380335http://forums.adobe.com/message/4380335
Can I do what I need in Air 3.3+ an iOS 5.1+ ?
Thank You
Copy link to clipboard
Copied
Hi koloaval,
Did you finally found a solution?
According to that:
and that:
http://blogs.adobe.com/airodynamics/2012/05/04/air-ios-background-behavior/
we should be able to execute task in background. But not any of my events (ENTER_FRAME, TIMER or SOUND_COMPLETE) are fired. SetTimeout neither.
My config:
Flex SDK 4.6 / AIR 3.4 / FlashDevelop / Windows 7
Please let me know if you have found something.
Regards
Copy link to clipboard
Copied
AIR 3.3 onwards, action script developers can execute short task in the background along with audio playback and location updates on iOS. In order to execute task in background, you would need to set
1) NativeApplication.nativeApplication.executeInBackground = true (in action script)
2) swf version should be 16 or more
3) namespace should be 3.3 or more (in application descriptor)
Please confirm if you have used the above settings in your app.
Copy link to clipboard
Copied
Hi,
I have NativeApplication.nativeApplication.executeInBackground = true in my Main.as
I also turn this property to true on NativeApplication.nativeApplication Event.DEACTIVATE
I compile with -swf-version=17 in my compiler options.
I use namespace 3.4 in the manifest.
I do my tests under iOS 6 on iPad 2, iPhone 4, iPhone 5, Acer Iconia tab/Android
And in my iOS manifest:
<key>UIApplicationExitsOnSuspend</key>
<false/>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>location</string>
</array>
I also tried with AIR 3.5 beta/-swf-version=18. Same issue on both Android and iOS.
Do you confirm that should work? Or am I trying to do something impossible?
Because this page says Bakground "networking". Do that mean only the pre-background loader.load calls are working in background?
Regards
Copy link to clipboard
Copied
Pease confirm if you are using renderMode direct or gpu in the manifest?
If renderMode is set to direct or gpu, execution in background won't be allowed on both Android and iOS.
Copy link to clipboard
Copied
Yes I'm using Starling so I have renderMode set to direct.
There's definitely no way to do background tasks using Stage3D?
Copy link to clipboard
Copied
nehgupta,
Could you please reply to my last message?
Thanks!
Copy link to clipboard
Copied
With Stage3D, you have to use renderMode direct and as i have mentioned earlier execution in background won't be allowed on Android and iOS in this case.
You might want to raise a feature request for this issue.
Copy link to clipboard
Copied
Thank you for your quick answer.
What's the best way to raise the feature request?
http://ideas.adobe.com/air redirects to http://forums.adobe.com.
Shall I post a simple new topic?
Cheers
Copy link to clipboard
Copied
You can raise the feature request on https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
Copy link to clipboard
Copied
When I select "Adobe AIR" in the list, I have "For feature requests, please submit ideas to the Adobe AIR Ideas website."
And as said earlier, the link redirects to http://forums.adobe.com/ ...
Copy link to clipboard
Copied
The good link is:
Copy link to clipboard
Copied
Nehgupta, Is it possible to change the render mode during the execution of an application? As in when a user "deactivates"/"activates" the app, can the render mode be switch as to allow background execution?
Copy link to clipboard
Copied
Spedronimo,
As far as I know, you can not change the renderMode dureing execution. Only in the manifest when compiling.
Copy link to clipboard
Copied
Hi ,
I am facing the same behaviur, my app work fine in foreground but when I move to backgroud they go to sleep.
When the app go to background I need to execute a http process each 15 secs, i read a lot threads without find any solution.
Anyone have a solution to work a simple http process in background, like how work skype?
Regards,
Peter
Copy link to clipboard
Copied
I agree it seems to be the case that renderMode can't be programatically changed. What is the reason that Stage3D can't support background location/audio tasks?
It's seriously crap that background execution isn't supported with 'direct' renderMode. Apart from some obscure messages on the forums like this there is nothing I've found to document that this is the case.
Adobe : I would suggest that if AIR is to become a genuine mobile framework this is one of the issues that must be resolved.
Copy link to clipboard
Copied
Guys,
I totally agree with you and I advise you to vote and comment the new "feature request" I raised here:
https://bugbase.adobe.com/index.cfm?event=bug&id=3349232
That will encourage Adobe to find a solution.
Copy link to clipboard
Copied
Hi,
This should be great but I think adobe isn't work enough to provide a real mobile framework, this lack of information confirm that.
Anyone can suggest me a workaround about the backrgound http proccess for a IOS app ?
Regards,
Peter
Copy link to clipboard
Copied
Hi,
I already try a few workaround with the same result, the background process isn't work.
I think isn't possible to run a simple http process in background on IOS.
This is a terrible news for my app because they already work fine on android and playbook but how isn't possible to do on IOS?
Any one have a new suggestion:
Regards,
Peter
Copy link to clipboard
Copied
Hey mate,
So far as I understand it only location and audio updates are available in the background on IOS... you may be able to trick your app into working if you hooked into one of these but it might be a bit of a long shot.
What we're complaining about above is that even though location and audio events are meant to be supported in IOS and Android, when the renderMode is changed to 'direct' this is not the case...
A
Copy link to clipboard
Copied
Background processing does not work if renderMode direct is used and it holds true for both iOS and Android.
Please confirm if you have set "NativeApplication.nativeApplication.executeInBackground" to true in your application?
You might want to refer this link for details on AIR iOS background behavior.
-Neha
Copy link to clipboard
Copied
Dude,
You might want to tell your posse down at Adobe that renderMode direct needs to be supported for background mode.
Serious failing otherwise.
A
Copy link to clipboard
Copied
Hi,
This is from adobe : Supporting background tasks on iOS
Adobe AIR 3.3 and higher supports multitasking on iOS by enabling certain background behaviors:
Audio
Location updates
Networking
Opting out of background app execution
We thing that networking is the right behavior from our apps but this seems to be for a single taks execution and we need to execute the same process each 15 secs.
Any one have know how execute a http process ech x secs in background using the Networking behavior ?
Any one know if it's possible ?
Regards,
Peter
Copy link to clipboard
Copied
If you are interested in getting background tasking on iOS/Android when using Stage3D, PLEASE VOTE FOR THE FEATURE REQUEST HERE:
Copy link to clipboard
Copied
voted... for what its worth.