Skip to content

Search

Документация

apple

Apple services beyond platform.: Game Center identity, Sign in with Apple, Game Center's screens. Calls answer task::wait on a later tick as a map whose…

На тази страница

Apple services beyond platform.*: Game Center identity, Sign in with Apple, Game Center's screens. Calls answer task::wait on a later tick as a map whose kind is an EVENT_* constant. What arrives unasked is the apple_event event, events::listen(node, "apple_event"): a URL opened, an invite, an iCloud change. Notifications are platform.notify, push platform.register_for_push, and purchases platform.purchase and the rest.

9 functions, 10 constants. Scripts reach it as apple::.

Functions

Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.

function acts on what it does
access_point(bool, apple::AccessPointOptions?) -> bool — Show or hide Game Center's floating access point, and answer whether it is showing.
available() -> bool — Whether this build has Apple's frameworks behind it.
credential_state(string) -> int — Ask whether a saved Sign in with Apple account is still authorized, revoked, transferred or unknown, and return the id the answer carries.
identity() -> int — Fetch the items a server needs to verify this Game Center player, and return the id the answer carries.
listen_for_cloud_changes() -> bool — Hear about another device changing the iCloud key-value store, as cloud_changed with the reason and the keys it touched.
listen_for_invites() -> bool — Hear about Game Center invites the player accepts, as invite_accepted with the sender's player id and name, and matches they ask for, as match_requested with the players.
listen_for_urls() -> bool — Hear about URLs the game is asked to open. A URL the game was launched with arrives the same way, once the engine is up.
show_dashboard(apple::ShowDashboardOptions?) -> int — Open Game Center's dashboard over the game, and return the id its dashboard_closed answer carries.
sign_in() -> int — Sign in with Apple, and return the id the identity token comes back on. Game Center's own sign-in is platform.sign_in.

Constants

name value
EVENT_CLOUD_CHANGED "cloud_changed"
EVENT_CREDENTIAL_STATE "credential_state"
EVENT_DASHBOARD_CLOSED "dashboard_closed"
EVENT_ERROR "error"
EVENT_IDENTITY "identity"
EVENT_INVITE_ACCEPTED "invite_accepted"
EVENT_MATCH_REQUESTED "match_requested"
EVENT_SIGNED_IN "signed_in"
EVENT_UNSUPPORTED "unsupported"
EVENT_URL "url"

Наистина ли?