Prerequisite: make sure you integrate the Game API and it’s loading correctly before continuing (see Load the API).
The Award will only be submitted when the game is running on a Spil Portal for game that have awards set on Spil Games system. For setting up the awards for a game, the developer needs to contact the game producer that is handling the integration.
The GameAPI is able to handle the Award submission call in any environment, so the game can always try to submit it no matter where it is running even though gameplays outside Spil Network will not be taken into account.
Only implement the below feature, if your game supports awards. Add below code at the location in your game source where you normally handle awards.
Once the awards are set up by the game producer, the game is able to submit awards through the GameAPI.Award.submit method. This method receives an object as a parameter that should have an award property with the string value provided by Spil Games.