#bevy-plugin #ios #bevy #swift #mobile #gamedev


Bevy Plugin and Swift Package to provide access to iOS native GameKit (Gamecenter) from inside Bevy Apps

10 releases

new 0.2.0 Jul 11, 2024
0.1.8 May 11, 2024

#591 in Game dev

Download history 326/week @ 2024-05-03 196/week @ 2024-05-10 55/week @ 2024-05-17 48/week @ 2024-05-24 14/week @ 2024-05-31 65/week @ 2024-06-07 32/week @ 2024-06-14 9/week @ 2024-06-21 1/week @ 2024-06-28

110 downloads per month

MIT license

608 lines


crates.io docs.rs discord

Bevy Plugin and Swift Package to provide access to iOS native GameKit (Gamecenter) from inside Bevy Apps It uses Swift-Bridge to auto-generate the glue code and transport datatypes.


Demo from our game using this crate: zoolitaire.com

See also bevy_ios_iap, bevy_ios_notifications, bevy_ios_alerts, bevy_ios_review & bevy_ios_impact


  • authentication
  • save games (based on iCloud)
  • achievements
  • leaderboards


  • challenges, matchmaking


  1. Add to XCode: Add SPM (Swift Package Manager) dependency
  2. Add Rust dependency
  3. Setup Plugin

1. Add to XCode

  • Add GameKit framework: gamekit

  • Go to File -> Add Package Dependencies and paste https://github.com/rustunit/bevy_ios_gamecenter.git into the search bar on the top right: xcode

Note: The rust crate used must be exactly the same version as the Swift Package. I suggest using a specific version (like 0.2.0 in the screenshot) to make sure to always use binary matching versions!

2. Add Rust dependency

cargo add bevy_ios_gamecenter


# always pin to the same exact version you also of the Swift package
bevy_ios_gamecenter = { version = "=0.2.0" }

3. Setup Plugin

Initialize Bevy Plugin:

// request auth right on startup
fn bevy_system() {
    // update achievement progress, 100 % will complete it

        "raking id".into(),
        // score
        // context

    // open gamecenter view (leaderboard)

    // save arbitrary binary buffer as a savegame
    bevy_ios_gamecenter::save_game("test".into(), vec![1, 2, 3].as_slice());

    // request list of `IosGCSaveGame`

    // based on result of above `fetch_save_games` request
    let save_game = IosGCSaveGame {..} 

Process Response Events from iOS back to us in Rust:

fn process_gamecenter_events(
    mut events: EventReader<IosGamecenterEvents>,
) {
    for e in events.read() {
        match e {
            IosGamecenterEvents::SaveGames(response) => todo!(),
            IosGamecenterEvents::Player(player) => todo!(),
            IosGamecenterEvents::Authentication(response) => todo!(),
            IosGamecenterEvents::SavedGame(response) => todo!(),
            IosGamecenterEvents::LoadGame(response) => todo!(),
            IosGamecenterEvents::AchievementProgress(response) => todo!(),
            IosGamecenterEvents::AchievementsReset(response) => todo!(),
            IosGamecenterEvents::LeaderboardScoreSubmitted(response) => todo!(),

Bevy version support

bevy bevy_ios_gamecenter
0.14 0.2,main
0.13 0.1


All code in this repository is dual-licensed under either:

at your option. This means you can select the license you prefer.

Your contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~445K SLoC