Getting auth for serverside for both Google Play Games and Apple Game Center
npm install react-native-game-auth
import { GameCenterAuth, PlayGamesAuth } from 'react-native-game-auth';
React.useEffect(() => {
if (PlayGamesAuth) {
PlayGamesAuth.onAuthStateChanged((isSignedIn: boolean): void => {
console.log('Play Games Auth State Changed', isSignedIn);
});
PlayGamesAuth.onAuthTokenChanged((s: string) => {
console.log('Play Games AuthToken', s);
});
}
if (GameCenterAuth) {
const x = GameCenterAuth.onAuthenticate((i) => {
console.log('Game Center auth status:', i)
});
GameCenterAuth.initAuth();
return () => {
x.remove();
};
}
return () => {};
}, []);
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT