Test using Construct Editor
Folllow the below steps to easily test the implementation of Web to Game events in your H5 game using Construct Editor.
Run the game in Construct Editor using the Preview Layout button.
When the game opens in a new browser window, open the browser’s Console. For example, if you are using Chrome on Mac, then press "CMD + Shift + i"
Paste the following code in the Console
postMessage({funcName: “string”, …other data}, "*")

Replace
string
with the name of the Web to Game event you are trying to test and...other data
with any parameters you want to pass (leave it blank if there are none). For example, to pause the game you can type:
postMessage({funcName: "game_pause"}, "*")

Note: You can ignore the Console message “Unexpected message type ‘undefined’”
Hit enter! This will simulate the event ArcPlay would be sending.
Voila! You can now repeat the Steps 4 and 5 to test the rest of the Web to Game events.
Last updated