Method is used to initialize ads API. It inject a special ads widget which is used to show video ads via other ads SDK methods.
Where:
frameId - id of an iframe in which ads widget will be placed. Optional parameter. If not specified ok-ads-frame id will be used;
callbackFunction - callback function that will be called after any other ads SDK method call. Optional parameter. If not specified default callback function will be used.
Callback
We recommend to specify a callback function with following signature:
Message object is passed to this function an has a following structure:
Where:
call - method call general info:
method - method name. Possible values: init, prepare, show;
arguments - additional arguments.
result - method call result:
status - result status. Possible values: ok, error;
code - additional result data.
Callback message
If ads API is successfully initialized following message will be passed to callback function:
If ads API was not initialized properly a message will contain following data: