@sendoracloud/sdk-react-native-gaming
v1.0.1
Published
Game Center (iOS) + Play Games (Android) native module for @sendoracloud/sdk-react-native — enables the no-arg auth.signInWithGameCenter() / auth.signInWithPlayGames(). Optional companion so non-gaming apps don't pull the Play Games dependency. Needs a De
Maintainers
Readme
@sendoracloud/sdk-react-native-gaming
Game Center (iOS) + Play Games (Android) native module for
@sendoracloud/sdk-react-native.
Install this optional companion only if your app uses email-less gaming
sign-in. It ships the native code (GameKit / Play Games) that lets the main SDK's
auth.signInWithGameCenter() / auth.signInWithPlayGames() run with no
arguments — the SDK fetches the provider identity payload for you.
Non-gaming apps should not install this package: it adds the Android
play-services-games-v2 dependency. The main SDK works fine without it (the
no-arg calls throw a clear "install this package" error; the explicit-payload
overloads still work everywhere).
Install
npx expo install @sendoracloud/sdk-react-native @sendoracloud/sdk-react-native-gamingNeeds a Dev Client — npx expo prebuild (or EAS Build). It does not work
in Expo Go (native code).
Configure (app.json / app.config.js)
{
"plugins": [
["@sendoracloud/sdk-react-native-gaming", {
"gameCenter": true, // iOS: Game Center capability
"playGamesWebClientId": "<web-oauth-client-id>.apps.googleusercontent.com", // Android: from Google Cloud (Web app OAuth)
"playGamesProjectId": "1234567890" // Android: Play Games project id (Play Console)
}]
]
}gameCenter: true→ adds thecom.apple.developer.game-centerentitlement (iOS).playGamesWebClientId+playGamesProjectId(both required) → writes the mandatorycom.google.android.gms.games.APP_IDand the Web OAuth client id the native module reads forrequestServerSideAccess(Android).
Then npx expo prebuild and rebuild.
Use (from the main SDK)
import { Sendora } from "@sendoracloud/sdk-react-native";
// iOS — drives the Game Center sheet + verifies natively:
await Sendora.auth.signInWithGameCenter();
// Android — drives Play Games sign-in + returns a server auth code:
await Sendora.auth.signInWithPlayGames();
// Link an anonymous device in place (keep the same user id):
await Sendora.auth.signInWithGameCenter({ link: true });Configure the matching provider in the Sendora dashboard (Auth Service → Settings → Gaming sign-in): the Game Center bundle-id allow-list, or the Play Games Web OAuth client id + secret.
Notes
- Player-keyed + email-less: Game Center = stable
teamPlayerID; Play Games = stable per-gameplayerId. No email or verified name. - The native module registers as
SendoraGameAuthonglobalThis.expo.modules; the main SDK reads it zero-dependency.
