nolimitApi

Connection to the game using MessageChannel

Methods

(inner) call(method, dataopt)

Call method in the open game

Source:
Parameters:
Name Type Attributes Description
method String

name of the method to call

data Object <optional>

optional data for the method called, if any

Example
// reload the game
api.call('reload');

(inner) on(event, callback)

Add listener for event from the started game

Source:
Parameters:
Name Type Description
event String

name of the event

callback function

callback for the event, see specific event documentation for any parameters

Example
api.on('deposit', function openDeposit () {
    showDeposit().then(function() {
        // ask the game to refresh balance from server
        api.call('refresh');
    });
});