1.0.0 • Published 4 years ago

@princesanjivy/cordova-plugin-leaderboard v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Cordova Leaderboard Plugin

Overview

Cordova plugin for Google Play Games Leaderboard service for android.

You need to set up your game in Google Play Developer console. Also have a look at https://developers.google.com/games/services/android/quickstart

Installation

cordova plugin add cordova-plugin-leaderboard --variable APP_ID=YOUR_APP_ID

or

cordova plugin add https://github.com/princesanjivy/cordova-plugin-leaderboard.git --variable APP_ID=YOUR_APP_ID

Usage

Place this inside of your deviceready function.

Sign in

leaderboard.init(
  function(){
    // on sign in success;
  },
  function(){
    // on failure ;
  }
);

Submit Score

leaderboard.setScore(
  leaderboard_id, // Leaderboard id
  score, // score to be submitted to that leaderboard
  function(){}, //successCallback
  function(){} // errorCallback
);

Show Leaderboard

leaderboard.setScore(
  leaderboard_id, // Leaderboard id
  function(){}, // successCallback
  function(){} // errorCallback
);

More Info

https://cordova.apache.org/plugins/

License

MIT license