I am creating a mobile app for iOS and Android, with flashbuilder 4.6, Flex SDK 4.6.
I am using a ANE for Google Cloud Messaging, which I would like to skip when compiling for iOS. Are there any defines within flashbuilder to check if its compiling for iOS or Android, so i can skip the GCM imports. I don't want to change my compiler defines every time i compile my app.
Another way would be to use an IF statement in the compiler arguments:
if (compiling for ios)
-define+=CONFIG::IOS,true
else
-define+=CONFIG::IOS,false
Is it possible to do something like this, or are there any built-in compiler defines I can use in my code?
EDIT: package managers has 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 on the classes from the ANE.
the 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();
}
}
}
}
CONFIG::IOS,true) as needed. - Sunil D.