Creating iOS plugins

    iOS plugins allow you to use third-party libraries and support iOS-specific features like In-App Purchases, GameCenter integration, ARKit support, and more.

    An iOS plugin requires a configuration file, a binary file which can be either .a static library or .xcframework containing .a static libraries, and possibly other dependencies. To use it, you need to:

    1. Copy the plugin’s files to your Godot project’s res://ios/plugins directory. You can also group files in a sub-directory, like res://ios/plugins/my_plugin.

    2. The Godot editor automatically detects and imports .gdip files inside res://ios/plugins and its subdirectories.

    3. You can find and activate detected plugins by going to Project -> Export… -> iOS and in the Options tab, scrolling to the Plugins section.

    When a plugin is active, you can access it in your using Engine.get_singleton():

    Creating an iOS plugin

    At its core, a Godot iOS plugin is an iOS library (.a archive file or .xcframework containing static libraries) with the following requirements:

    • The library must have a dependency on the Godot engine headers.

    • The library must come with a .gdip configuration file.

    An iOS plugin can have the same functionality as a Godot module but provides more flexibility and doesn’t require to rebuild the engine.

    Here are the steps to get a plugin’s development started. We recommend using Xcode as your development environment.

    See also

    The Godot iOS plugins.

    The Godot iOS plugin template gives you all the boilerplate you need to get your iOS plugin started.

    1. Create an Objective-C static library for your plugin inside Xcode.

    2. Add the Godot engine header files as a dependency for your plugin library in HEADER_SEARCH_PATHS. You can find the setting inside the Build Settings tab:

    3. In the Build Settings tab, specify the compilation flags for your static library in OTHER_CFLAGS. The most important ones are -fcxx-modules, -fmodules, and -DDEBUG if you need debug support. Other flags should be the same you use to compile Godot. For instance:

    1. Add the required logic for your plugin and build your library to generate a .a file. You will probably need to build both debug and target .a files. Depending on your needs, pick either or both. If you need both debug and release .a files, their name should match following pattern: [PluginName].[TargetType].a. You can also build the static library with your SCons configuration.

    2. The iOS plugin system also supports .xcframework files. To generate one, you can use a command such as:

    1. Create a Godot iOS Plugin configuration file to help the system detect and load your plugin: