Step 1: AppLixir Account Setup
AppLixir Account Setup Use of this extension requires an AppLixir Developer account and entry for each game. For testing the functionality, you can use a temporary Test ID. Once you are done testing, please visit this AppLixir.com to create a Live account.
Step 2: Reward Video Design
Considerations Reward Videos can only be shown on an explicit request by the end-user. This requires the game to have a button the user can click when they want to show a reward video. This is typically tied to specific game functionality such as when the user has no lives remaining and must either purchase more or watch a video to obtain a life. There are many other strategies that can be used plus there are consideration such as how frequently videos can be shown and how many can be viewed within a period of time (hour, day etc) More information about how to incorporate reward video ads into your game, please visit applixir.com/blog.
Step 3: Adding AppLixir
AppLixir Reward Videos must be tied to the domain they are served under. Ad Security requires that ‘ads.txt’ file containing all valid advertisers for the domain publisher. This ads.txt file must be collocated with the primary domain HTML file (eg. Index.html) in a folder with or under the game file.
Select one of these options:
- This is a single game and the ads.txt file will be in the same directory as this game’s index.html.
- There is a separate html file located at the given path. When the game is built, the file at this path will be updated (if needed ) with the correct changes.
- The test will be added manually to the primary html file.
The next step will be to add an AppLixir integration script. Select the location for your scopts folder and click the Apply button. The script may not be recognized by cocos creator right away. If it is not, minimize and then reopen the Cocos creator window and it will detect the newscript in the asset manager.
Step 4: Link AppLixir to your game
In order for the ads to be displayed, the applixir script created in “Adding AppLixir” must be added to the scene that contains the button that will trigger the ad and the script that will process the status updates. Adding AppLixir to scene Drag the AppLixir script asset from the asset manager to the scene that contain the reward button and the handling script
Link AppLixir to button click Create event handler for applixir In the AssetManager, select the script that will handle the events triggered by AppLixir and open it for editing. Add a property in the class declaration like this:
Public applixir: AppLixir – null;
Step 5: Declare an event handler in the start method:
Start () {
this.applixir?,node.on(“ApplixirStatusChange”, this.onApplixirStatusUpdate, this);
}