$ show godot-sdk-integrations/godot-ios-plugins
This repository provides a set of native iOS plugins for the Godot game engine, enabling integration with Apple platform services such as Push Notifications, ARKit, Camera, Game Center, iCloud Key-Value Store, In-App Purchases, and Photo Picking. Each plugin is a self-contained Godot extension written in C++ and Objective-C, with a .gdip configuration file for building. The codebase is structured to support both Godot 3.x and 4.0 (via conditional compilation), though the ARKit plugin is exclusive to 3.x. The plugins expose singletons to GDScript for straightforward use. The repository includes a SCons-based build system and scripts for generating XCFrameworks. While the code is functionally complete and demonstrates competent bridging between Godot and iOS native APIs, it has seen no commits since July 2021 and targets Godot 4.0, which is now several versions behind the current Godot 4.4 release. This staleness means some API details may have drifted, and the plugins may require adaptation for newer Godot versions. The repository is best viewed as a reference implementation for Godot iOS plugin development rather than a drop-in solution for modern Godot projects.
The LLM identified 2 files worth highlighting for reuse:
Provides two functions `nsobject_to_variant` and `variant_to_nsobject` that recursively convert between Apple's NSObject types (NSString, NSData, NSArray, NSDictionary, NSNumber, NSDate) and Godot's Variant types. This is a reusable pattern for any Godot iOS plugin that needs to exchange complex data with native iOS APIs. The implementation handles variant types like PoolByteArray, float, int, bool, Dictionary, Array, and String, with proper error handling for unsupported types.
Contains a class method `newRGBA8CGImageFromUIImage:` that converts a UIImage to a CGImage in RGBA8 format, handling all image orientations (up, down, left, right, mirrored variants) via Core Graphics affine transforms. The resulting raw pixel data is then used to construct a Godot Image object. This pattern is reusable for any plugin that needs to capture or process image data from iOS and pass it to Godot, as it correctly handles orientation and pixel format.