Apple Game Center

Type Library
Revision Release 2024.3703
Keywords gameNetwork, Game Center
Platforms iOS

Overview

Game Center lets friends in on the action with leaderboards and achievements. The nomenclature used in the Solar2D APIs for Game Center attempt to match the official Game Center APIs as much as possible, allowing you to cross-reference with official Game Center documentation.

Important
  • As of August 16, 2023, new apps and app updates that offer Game Center features need to include the Game Center entitlement. See Project Settings below and enable Game Center Support for Apple App ID Configuration.

Gotchas

Game Center is not supported in the simulator.

Syntax

local gameNetwork = require( "gameNetwork" )

Functions

gameNetwork.init()

gameNetwork.request()

gameNetwork.show()

Project Settings

To use this plugin, add an entry into the plugins table of build.settings. When added, the build server will integrate the plugin during the build phase.

Also be sure to add the iPhone entitlement table as seen below

settings =
{
    plugins =
    {
        ["CoronaProvider.gameNetwork.apple"] =
        {
            publisherId = "com.coronalabs"
        },
    },
    iphone = {
        entitlements = {
            ["com.apple.developer.game-center"] = true,
        },
    }
}

Sample project

Source