react-native-cross-platform-game-services
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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

Package Sidebar

Install

npm i react-native-cross-platform-game-services

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

21.5 kB

Total Files

16

Last publish

Collaborators

  • shukerullah