Warning These docs are currently subject to change

Share

The share Javascript SDK allows you to share information on the platform the game is played on. Depending what platform the game is running on, it will share the information in different places. For example, a notification on Miniclip's website might look different to a notification on Facebook's website.

To use the share Javascript SDK you need to do 3 things:

  1. In the body tag add the attributes data-platform="miniclip", data-platformappid="#your miniclip app id#" and data-facebook-app-id="#your facebook app id#". For example:
    //If your miniclip app ID is 123456789 and your facebook app ID is 987654321
    <body data-platform="miniclip" data-platformappid="123456789" data-facebook-app-id="987654321">
  2. include the file https://static.miniclipcdn.com/js/mc.js
  3. Once this script is included, you then need to initialise the API with the module you want to use. In this case it is the Share module. For example:
    <script type="text/javascript">
    	MC.init({
    		modules: ['Share']
    	});
    </script>

Once the API initialised you can start calling the share Javascript SDK methods.

Available methods

All these methods are asynchronous, so they need to be passed a callback if you want to capture a response.

Method name Description
MC.Share.highscore Publishes the user's highscore to the current platform
MC.Share.invite Sends a notification to the current platform to one or more player's friends, inviting them to play the game
MC.Share.challenge Sends a notification to the current platform to one or more player's friends, challenging them to play the game
MC.Share.award Publishes to the current platform that a user has achieved an award

More information in the FAQ section