It looks like suspend is not being defined in airglobal.swc. It just says (line 836 of flash.events.Event.as):
public static const SUSPEND : String;
Also, when attempting to compile in, ah, Flash CS<NDA> with "AIR 3.3.0.3230 for iOS" as the target, adding <executeInBackground>true</executeInBackground> to the app xml's <iPhone> node results in an alert:
Unexpected or unknown element or attribute in the application descriptor file.
application.iPhone.executeInBackground is an unexpected element/attribute
Is there any way to test these things with this beta?
It happens to me as well. I did try to put this variable in flash coding, but I need try {} catch to be able to test in flash builder otherwise it crash with no error appear.
try {
NativeApplication.nativeApplication.executeInBackground = true;
} catch (e:Error) {
} //Without try catch.. Flash builder crash at this line with no error notification. But in iPhone4 without try catch it runs fine
However, when I test my application in iPhone4 iOS 5.01, I got nothing when the app is in background (I tested by firing post variable via url loader to server with enterframe event 40-50 frame once, and by add location update event listener to Geo object also).
I think the problem is <executeInBackground>true</executeInBackground> which is added to <iPhone> tag in app.xml can't be compile by flash builder.
note: I've also changed application description to air 3.3
<application xmlns="http://ns.adobe.com/air/application/3.3">
and added location service in
<InfoAdditions><![CDATA[
<key>UIDeviceFamily</key>
<array>
<string>1</string>
<string>2</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
]]></InfoAdditions>
The same here. Tryed this:
<iPhone>
<InfoAdditions><![CDATA[
<key>UIDeviceFamily</key>
<array>
<string>1</string>
<string>2</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
]]></InfoAdditions>
<requestedDisplayResolution>high</requestedDisplayResolution>
<executeInBackground>true</executeInBackground>
</iPhone>
Got this:
Error occurred while packaging the application:
/private/var/folders/hS/hSnReJAjFeuPVy-AYoffRE+++TI/-Tmp-/AOT133495998 3779/NativeiOSMaps-app.xml(271): error 103: application.iPhone.executeInBackground is an unexpected element/attribute
executeInBackground exists only as a property and not as a tag in the descriptor xml.
http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/ 3/whatsnew.html
-romil
Thanks Gang. It worked now. But it was for another reason.
I am building an App that uses a Native Extension of GoopleMaps iOS API.
( http://code.google.com/p/air-maps-ane/ )
I was relying on the Native GPS event. And I am pretty sure it doesnt work in background doesnt matter how you set your app descriptor.
When I switch to as3 Geoloaclization events, it just started working.
Do you know if there is any conditions to use the background behavior with Native Extensions?
Could you please confirm if you have set the “NativeApplication.nativeApplication.executeInBackground” to true in Action script code and “UIBackgroundModes” tag to “location” in iPhone section of application descriptor?
If either of this information is missing from your app, please try running the app after adding them and do let us know the result.
-Neha
North America
Europe, Middle East and Africa
Asia Pacific