• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

air 3.3 and background ios apps

New Here ,
Aug 13, 2012 Aug 13, 2012

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

TOPICS
Development

Views

9.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 06, 2012 Nov 06, 2012

Copy link to clipboard

Copied

Thank you Spedronimo.

I really hope it will be fixed soon or we'll all have to start learning another programming language...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 28, 2012 Nov 28, 2012

Copy link to clipboard

Copied

So, after looking at the bug report - the status is now "closed/withdrawn" with the reasoning of "As Designed"?

So Adobe, you designed this problem and have no plans to fix it?

Could we get any type of answer on this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 28, 2012 Nov 28, 2012

Copy link to clipboard

Copied

How could such a big hole in the background processing of the software model be 'as designed'?

I would suggest this may be a big blocker to people using AIR as a platform to develop mobile apps. I know I won't be recommending it until this issue is resolved.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 19, 2013 Apr 19, 2013

Copy link to clipboard

Copied

Actually, I have tested in my app that, on Android at least ( didn't test on iOS ), execution in the background WILL work if renderMode = gpu, but NOT if renderMode = direct.

In other words, direct appears to be the only render mode which prevents background execution.  Unfortunately, the direct render mode is necessary for the Stage3D API to work ( which I have also verified ).

=================================

Why this is a problem for me ( my use case 😞

I am making a graphical alarm clock for Android/iOS, and recently implemented full hardware acceleration via Stage3D.  On iOS, I am using local notifications to alert the user when alarm goes off and the app is minimized or closed.  Said iOS local notification is scheduled ahead of time, if the alarm has been set, when the app is deactivated. 

On Android, unfortunately, I cannot use the same strategy because local notifications on this platform cannot be scheduled ahead of time.  Furthermore, with the app minimized and using direct render mode, I cannot trigger the local notification on the spot, while the app is minimized but running in the background.  So I am stuck.

The right solution would be:

1) Allow background execution when the direct render mode is used ( preffered ).

2) Use an ANE for the AlarmManager on Android ( none available on the net, as of this writing ).

3) Use push notifications:  very heavy handed ( requires server side scripting to schedule the notification ).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 04, 2013 Sep 04, 2013

Copy link to clipboard

Copied

Hello AsterLUXman,

I am new to mobile develpment and creating a reminder application for Android & IOS using Flash Builder 4.6, Air 3.1. After surfing on net I got that we need to use ANE for the Alarm manager and Push notifications for the Alerts for Android platform. I am confused for this thing. Is there any simple way to create the application in Android.

Kindly Guide/Refer me for the way to develop background running application in Flash Builder 4.6.

Thanks in advance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 30, 2013 Dec 30, 2013

Copy link to clipboard

Copied

Some of the statements in this thread are no longer true, or need to be updated.

Here is a recap:

  • As of AIR 3.9, background execution will work on iOS+Android with render mode set to 'direct' ( which implies that you are using Stage3D ).

  • For background execution to work in iOS, you need:

    • to set NativeApplication.nativeApplication.executeInBackground = true, in your as3 code somewhere ( note: strangely, background exec on iOS has worked for me in the past even by not doing that ).

    • to add in the iPhone section of your app manifest ( *-app.xml 😞

      • UIApplicationExitsOnSuspend = false

      • UIBackgroundModes = audio ( and/or location, or some other background mode ).

    • a good excuse / reason :  since battery-gate on the iPhone4, Apple has  tightened its policies regarding background execution.  For example:  last time I tried, setting UIBackgroundModes=audio was only allowed if the app was intended to play a sound persistently in the background ( not occasionally, such as an alarm clock sound ).

  • For local notifications, I recommend Distriqt's local notification ANE ( Android+iOS), since it's the ony one I know which uses the AlarmManager api on Android ( Koesler's Android Local notif doesn't last time I checked ).  This means that on Android, the local notification can be scheduled for a later time ( same as iOS ), and will fire EVEN if the app is either minimized or has been closed properly ( meaning closed by the OS, or by the user via NativeApplication.nativeApplication.exit() -- note: force-stopping is the exception and cancels scheduled notifications on Android ).  You can also have the local notification play a custom sound which is up to 30 secs long ( mp3s on Android / cafs on iOS).  Sound will be audible on both platforms, even if the device is suspended.  This is ideal for an alarm-clock, for example.  The downside of local notifs is that they don't execute code, per se, however they can pass a data payload ( text ) back to the app, if it is running ( even if minimized ), which a handler can receive to do stuff.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 14, 2014 Oct 14, 2014

Copy link to clipboard

Copied

LATEST

Hey, thanks for updating this.   I know its a year later now but it was cool that you posted updated info for folks chasing down these same answers.  I just wish Apple wasnt so strict with background modes usage...  Google will let you upload almost ANYTHING you can build, but iOS, not so much.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 03, 2012 Dec 03, 2012

Copy link to clipboard

Copied

This really is a big bummer and I don't see how this is not a high priority issue, regardless of the implications it may have.

Saying this is "as designed" simply shows that the design has some major flaws.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2013 Feb 07, 2013

Copy link to clipboard

Copied

Hi People,

I've reposted this as a bug... vote for it again if you think its worth the effort.

https://bugbase.adobe.com/index.cfm?event=bug&id=3497587

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines