react-native-cross-platform-game-services
v0.0.4
Published
Supercharge your React Native games with seamless cross-platform achievements and leaderboards!
Downloads
3
Readme
React Native Cross Platform Game Services
Currently Available for Android
Supercharge your React Native games with seamless cross-platform achievements and leaderboards!
Installation
yarn add react-native-cross-platform-game-services
Usage
This module provides a unified API for integrating Google Play Games Services into your React Native project.
Important Note: While the API is designed for cross-platform functionality, iOS support is currently under development.
Here's how to use the available functions:
import {
signIn,
isSignedIn,
signOut,
unlockAchievement,
incrementAchievement,
showAchievements,
submitScoreToLeaderboard,
showLeaderboard
} from 'react-native-cross-platform-game-services';
function _signIn(callback: () => void) {
signIn(callback);
}
function _isSignedIn(callback: () => void) {
isSignedIn(callback);
}
function _signOut() {
signOut();
}
function _unlockAchievement(achievementId: string) {
unlockAchievement(achievementId);
}
function _incrementAchievement(achievementId: string, increment: number) {
incrementAchievement(achievementId, increment);
}
function _showAchievements() {
showAchievements();
}
function _submitScoreToLeaderboard(leaderboardId: string, score: number) {
submitScoreToLeaderboard(leaderboardId, score);
}
function _showLeaderboard(leaderboardId: string) {
showLeaderboard(leaderboardId);
}
Contributing
Contributions are always welcome, no matter how large or small!
License
MIT