I am creating a mobile application for iOS and Android, with flashbuilder 4.6, Flex SDK 4.6.
I use ANE for Google cloud messaging that I would like to skip when compiling for iOS. Are there any definitions in flashbuilder to check if its compiling for iOS or Android, so I can skip the GCM import. I donβt want to change my compiler every time I compile my application.
Another way is to use the IF statement in compiler arguments:
if (compiling for ios) -define+=CONFIG::IOS,true else -define+=CONFIG::IOS,false
Is it possible to do something similar or is there a built-in compiler that I can use in my code?
EDIT: package managers have 3 classes:
- NotificationManager.as
- NotificationManagerIOS.as (Singleton for iOS, uses RemoteNotification from Air)
- NotificationManagerAndroid.as (Singleton for Android, uses ANE, which does not support iOS)
Compiling for android is fine, compiling for iOS gives errors in classes from ANE.
NotificationManager.as:
package managers { public class NotificationManager { public static function getInstance():NotificationManager { var ios:Boolean = (Capabilities.manufacturer.indexOf("iOS") != -1); if (ios) { return NotificationManagerIOS.getInstance(); } else { return NotificationManagerAndroid.getInstance(); } } } }
source share