@Retention(CLASS) @Target({TYPE})

public @interface Ios

iOS build hints, checked by the compiler.

Place this on your application’s main class – the class named by codename1.mainName. An attribute you do not set is not written at all, so the build server’s own default applies. The default clause below each attribute names a constant that says nothing – see HintUnset – and this package deliberately does not record what the server would do instead, because that is the server’s to change.

The platform is stated once on the annotation, not on every attribute. An attribute repeats it only to disagree with it.

Methods

public abstract String[] addLibs() default {}A semicolon separated list of libraries that should be linked to the app to build it
public abstract String[] applicationQueriesSchemes() default {}Comma separated list of url schemes that canExecute will respect on iOS.
public abstract String beforeFinishLaunching() default ""Objective-C code that can be injected into the iOS app delegate at the top of the body of the didFinishLaunchingWithOptions callback method
public abstract String bundleVersion() default ""Indicates the version number of the bundle, this is useful if you want to create a minor version number change for the beta testing support
public abstract IosDependencyManager dependencyManager() default IosDependencyManager.DEFAULTWhich native dependency manager to use: auto picks one from whichever of ios.pods and ios.spm.packages is set, and cocoapods, spm or both require the matching hint to be set.
public abstract String deploymentTarget() default ""Minimum iOS version the build targets.
public abstract String glAppDelegateHeader() default ""Objective-C code that can be injected into the iOS app delegate at the top of the file.
public abstract Toggle includePush() default Toggle.DEFAULTtrue/false (defaults to false).
public abstract String interfaceOrientation() default ""UIInterfaceOrientationPortrait by default.
public abstract String minDeploymentTarget() default ""The null and empty-string reads of this hint are presence checks; 6.0 is the substantive one.
public abstract Toggle newStorageLocation() default Toggle.DEFAULTStores app files under the documents directory rather than caches, which is the location Apple recommends but which may break compatibility with an app that already shipped.
public abstract Toggle objC() default Toggle.DEFAULTAdded the -ObjC compile flag to the project files which some native libraries require
public abstract String plistInject() default ""entries to inject into the iOS plist file during build.
public abstract String[] pods() default {}A comma separated list of https://cocoapods.org/[Cocoa Pods] that should be linked to the app to build it.
public abstract String podsPlatform() default ""Sets the Cocoapods ‘platform’ for the Cocoapods.
public abstract String[] podsSources() default {}Extra CocoaPods spec repositories to search, in addition to the default trunk.
public abstract Toggle prerenderedIcon() default Toggle.DEFAULTtrue/false defaults to false.
public abstract IosProjectType projectType() default IosProjectType.DEFAULTone of ios, ipad, iphone (defaults to ios).
public abstract String[] spmPackages() default {}Swift Package Manager packages to link, one per entry, each written as identity|url|requirement.
public abstract String teamId() default ""Specifies the team ID associated with the iOS provisioning profile and certificate.
public abstract ThemeMode themeMode() default ThemeMode.DEFAULTauto (default), modern, ios7, legacy.
public abstract Toggle uiscene() default Toggle.DEFAULTtrue/false (defaults to true).
public abstract String urlScheme() default ""Allows intercepting a URL call using the syntax <string>urlPrefix<string>

Method details

addLibs

public abstract String[] addLibs() default {}
A semicolon separated list of libraries that should be linked to the app to build it

applicationQueriesSchemes

public abstract String[] applicationQueriesSchemes() default {}
Comma separated list of url schemes that canExecute will respect on iOS. If the url scheme isn’t mentioned here canExecute will return false starting with iOS 9. Notice that this collides with ios.plistInject when used with the <key>LSApplicationQueriesSchemes</key>... value so you should use one or the other. For example, to enable canExecute for a url like myurl://xys you can use: myurl,myotherurl

beforeFinishLaunching

public abstract String beforeFinishLaunching() default ""
Objective-C code that can be injected into the iOS app delegate at the top of the body of the didFinishLaunchingWithOptions callback method

bundleVersion

public abstract String bundleVersion() default ""
Indicates the version number of the bundle, this is useful if you want to create a minor version number change for the beta testing support

dependencyManager

public abstract IosDependencyManager dependencyManager() default IosDependencyManager.DEFAULT
Which native dependency manager to use: auto picks one from whichever of ios.pods and ios.spm.packages is set, and cocoapods, spm or both require the matching hint to be set. An unrecognized value fails the build.

deploymentTarget

public abstract String deploymentTarget() default ""
Minimum iOS version the build targets. Set it to the lowest iOS you actually support; a higher value excludes older devices from the App Store listing.

glAppDelegateHeader

public abstract String glAppDelegateHeader() default ""
Objective-C code that can be injected into the iOS app delegate at the top of the file. For example, if you need to include headers or make special imports for other injected code

includePush

public abstract Toggle includePush() default Toggle.DEFAULT
true/false (defaults to false). Whether to include the push capabilities in the iOS build. Notice that the IDE plugin has an “Include Push” check box you should use under the iOS section.

interfaceOrientation

public abstract String interfaceOrientation() default ""
UIInterfaceOrientationPortrait by default. Indicates the orientation, one or more of (separated by colon :): UIInterfaceOrientationPortrait, UIInterfaceOrientationPortraitUpsideDown, UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight. Notice that the IDE plugin has an “Interface Orientation” combo box you should use under the iOS section.

minDeploymentTarget

public abstract String minDeploymentTarget() default ""
The null and empty-string reads of this hint are presence checks; 6.0 is the substantive one.

newStorageLocation

public abstract Toggle newStorageLocation() default Toggle.DEFAULT
Stores app files under the documents directory rather than caches, which is the location Apple recommends but which may break compatibility with an app that already shipped. Described in https://github.com/codenameone/CodenameOne/issues/1480[this issue]

objC

public abstract Toggle objC() default Toggle.DEFAULT
Added the -ObjC compile flag to the project files which some native libraries require

plistInject

public abstract String plistInject() default ""
entries to inject into the iOS plist file during build.

pods

public abstract String[] pods() default {}
A comma separated list of https://cocoapods.org/[Cocoa Pods] that should be linked to the app to build it. For example, AFNetworking ~> 2.6, ORStackView ~> 3.0, SwiftyJSON ~> 2.3

podsPlatform

public abstract String podsPlatform() default ""
Sets the Cocoapods ‘platform’ for the Cocoapods. Some Cocoapods require a minimum platform level. For example, ios.pods.platform=7.0.

podsSources

public abstract String[] podsSources() default {}
Extra CocoaPods spec repositories to search, in addition to the default trunk.

prerenderedIcon

public abstract Toggle prerenderedIcon() default Toggle.DEFAULT
true/false defaults to false. The iOS build process adapts the submitted icon for iOS conventions (adding an overlay) that might not be appropriate on some icons. Setting this to true leaves the icon unchanged (only scaled).

projectType

public abstract IosProjectType projectType() default IosProjectType.DEFAULT
one of ios, ipad, iphone (defaults to ios). Indicates whether the resulting binary is targeted to the iphone only or ipad only. Notice that the IDE plugin has a “Project Type” combo box you should use under the iOS section.

spmPackages

public abstract String[] spmPackages() default {}
Swift Package Manager packages to link, one per entry, each written as identity|url|requirement.

teamId

public abstract String teamId() default ""
Specifies the team ID associated with the iOS provisioning profile and certificate. Use ios.debug.teamId and ios.release.teamId to specify different team IDs for debug and release builds respectively.

themeMode

public abstract ThemeMode themeMode() default ThemeMode.DEFAULT

auto (default), modern, ios7, legacy. auto (unset) keeps the existing iOS 7 flat theme so pre-refactor screenshot goldens and apps see no behavior change. modern / liquid opts in to the CSS-generated iOS Modern (liquid-glass) theme shipped from native-themes/ios-modern/theme.css. ios7 / flat is the same as auto

  • pre-liquid iOS 7 flat theme; legacy / iphone loads the pre-iOS 7 iPhone theme. The auto -> modern flip is planned for a future release.

uiscene

public abstract Toggle uiscene() default Toggle.DEFAULT
true/false (defaults to true). Enables iOS UIScene lifecycle support. UIScene lets iOS manage one or more app UI sessions independently, improving lifecycle handling in modern iOS versions. Apple has indicated UIScene will be required starting with iOS 27, so this is now on by default; set the flag to false only if you need to temporarily fall back to the legacy UIApplicationDelegate lifecycle.

urlScheme

public abstract String urlScheme() default ""
Allows intercepting a URL call using the syntax <string>urlPrefix<string>