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
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
Place this inside of your deviceready
function.
leaderboard.init(
function(){
// on sign in success;
},
function(){
// on failure ;
}
);
leaderboard.setScore(
leaderboard_id, // Leaderboard id
score, // score to be submitted to that leaderboard
function(){}, //successCallback
function(){} // errorCallback
);
leaderboard.showLeaderboard(
leaderboard_id, // Leaderboard id
function(){}, // successCallback
function(){} // errorCallback
);
Construct2 Play Games Leaderboard
https://cordova.apache.org/plugins/
MIT license