Expand description
bevy_ios_toolkit — native iOS integrations for Bevy, as ordinary ECS
resources and messages.
Each integration is a cargo feature and a module:
| feature | module | what it bridges |
|---|---|---|
storekit | store | StoreKit environment + in-app purchases (iOS only) |
ads | ads | Google AdMob ads + UMP consent |
att | att | App Tracking Transparency prompt |
gamekit | gamekit | Game Center auth, leaderboards, achievements |
review | review | StoreKit review prompt |
platform | platform | haptics, safe-area insets, links, share sheet, thermal/low-power state, boot shield, audio session |
No feature is on by default. Enable exactly what you ship — a module’s
extern "C" block only exists when its feature is on, and the matching Swift
shim must be in your Xcode target or iOS linking fails on undefined symbols.
[dependencies]
bevy_ios_toolkit = { version = "0.4", features = ["ads", "att"] }
[target.'cfg(target_os = "ios")'.dependencies]
bevy_ios_toolkit = { version = "0.4", features = ["storekit"] }§The native contract
Shared across every native module:
- Every native entry point is
@_cdeclC-ABI, called from Rust. - Async, delegate-driven SDK work surfaces as polled state (or a drained event queue) read once per frame — never callbacks into Rust, because re-entrancy against winit’s event loop is not safe.
- Each Swift shim sits behind
#if canImport(...)with linking stubs, so the staticlib links on any target.
Off iOS, integrations keep a fake only where a real cross-platform flow
benefits from one. StoreKit purchases are platform-owned: store is iOS
only and has no desktop backend.
use bevy::prelude::*;
use bevy_ios_toolkit::prelude::*;
fn main() {
App::new()
.add_plugins((MinimalPlugins, IosPlugin))
.run();
}Modules§
- ads
- Google AdMob ads as Bevy resources + messages.
- att
- App Tracking Transparency (ATT) as Bevy resources + messages.
- gamekit
- Game Center (GameKit) as Bevy resources + messages: authentication, leaderboard score submission, and achievement reporting.
- platform
- Apple-platform integrations — thin wrappers over the
PlatformSwift shim (one.swiftfile per concern underSources/Platform/), no-ops off iOS. - prelude
- review
- Ask for an App Store rating via
SKStoreReviewController/AppStore. - store
- StoreKit 2 in-app purchases as Bevy resources + messages.
Structs§
- IosPlugin
- Installs every enabled iOS integration. Composition is feature-driven: a module only wires its systems when its feature is on.