1.2.4 • Published 11 months ago

cordova-plugin-galaxy v1.2.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
11 months ago

Table of content

Installation

$ cordova plugin add cordova-plugin-galaxy

Setup

Add the following lines to your code to be able to initialize tracking with your own Galaxy Publishable key:

document.addEventListener('deviceready', function() {

  // InitSDK
  window.galaxy.InitSDK({
    publishableKey: 'Your Galaxy Publishable Key',
  }, (result) => {
    console.log(result);
  }, (error) => {
    console.error(error);
  });


  /* Client API */

  // ReportScore
  document.getElementById('button').addEventListener(
    'click',
    (e) => window.galaxy.ClientAPI.ReportScore({
      leaderboard_id: 'Your Leaderboard Id',
      score: 1,
    }, (result, error) => {
      console.log(result);
    }),
  );


  /* Galaxy UI */

  // ShowLeaderboard
  document.getElementById('button').addEventListener(
    'click',
    (e) => window.galaxy.ShowLeaderboard({
      leaderboard_id: 'Your Leaderboard Id',
    }, (result) => {
      console.log(result);
    }, (error) => {
      console.error(error);
    }),
  );

  // ShowAvatarEditor
  document.getElementById('button').addEventListener(
    'click',
    (e) => window.galaxy.ShowAvatarEditor((result) => {
      console.log(result);
    }, (error) => {
      console.error(error);
    }),
  );

  // ShowClan
  document.getElementById('button').addEventListener(
    'click',
    (e) => window.galaxy.ShowClan({
      leaderboard_id: 'Your Leaderboard Id',
      clan_id: 'clan id'
    }, (result) => {
      console.log(result);
    }, (error) => {
      console.error(error);
    }),
  );

 }, false);

1.2.0

11 months ago

1.1.9

11 months ago

1.1.8

11 months ago

1.1.7

11 months ago

1.2.4

11 months ago

1.2.3

11 months ago

1.2.2

11 months ago

1.1.6

11 months ago

1.1.5

11 months ago

1.1.4

11 months ago

1.1.0

1 year ago

1.0.9

1 year ago

1.1.3

12 months ago

1.1.2

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago