Log in to the management end and create a developer account.
Select Create Game under Developers on the management end to create a new game, and fill in the necessary game information after creation.
Place gamebridge-sdk.js in the head area, loading before the game script.
<script
id="gamebridge-sdk"
src="https://sdk.beesads.com/v1/gamebridge.js"
data-test="on"
data-gameid="{gameId}">
</script>- id: the fixed ID of the script, which is mandatory.
- src: the fixed loading address of the script, which is mandatory.
- data-test: indicates whether to enable test advertising. It is used for advertising debugging. This parameter must be cleared in the product environment. Available values: 'on', 'off'
- data-gameid: Unique identifier of the game. It is generated after the game is created on the management end, which is mandatory.
After gamebridge-sdk.js loads, the GameBridgeSDK object will be mounted on the window. initialization methods: window.GameBridgeSDK.init().
// Execute the initialization function
window.GameBridgeSDK.init().then(() => {
// Recommended to execute the initializer for the game here
});Game resource loading event, which allows developers to communicate to the SDK when resource loading starts and ends.
// When the game resource is loaded, it will automatically trigger the pre-movie adverts
window.GameBridgeSDK.gameLoadingStart();
// Invoked after the game resource is successfully loaded
window.GameBridgeSDK.gameLoadingFinished();Developers can configure the SDK by mounting the GAME_BRIDGE_CONFIG object on the window. Currently supported configuration items: pause, resume. When the AD is called or finished, the SDK will perform corresponding operations on the game through the pause and resume method in the configuration item.
window.GAME_BRIDGE_CONFIG = {
// Registered game suspension
pause: () => {
// The method of pausing the game
},
// Register the game back
resume: () => {
// The method of pausing the game
}
}
To better analyze game behavior, the developer should call the following methods at appropriate points.
For example, call window.GameBridgeSDK.gameplayStart() at the start of a level game.
// Turn-based games: Start
window.GameBridgeSDK.roundStart();
// Turn-based games: End
window.GameBridgeSDK.roundEnd();
// level game: Start
window.GameBridgeSDK.gameplayStart();
// level game: End
window.GameBridgeSDK.gameplayStop();
// Happy hour
window.GameBridgeSDK.happyTime();// Check window.GameBridgeSDK.ready to see if the SDK is ready
if (window.GameBridgeSDK.ready) {
// ready
} else {
// not ready
}if (window.GameBridgeSDK.isAdBlocked()) {
// The current device disable ads
} else {
// The current device does not disable ads
}commercialBreak is used to display interstitial ads. It should be triggered at the end of a level or other time point during the break period.
window.GameBridgeSDK.commercialBreak(() => {
// Invoke pre-function
}).then((status) => {
// Invoke the completion function, where the status parameter returns the current AD display status
});rewardedBreak is used to display reward ads, which should be triggered by the user (for example, after completing the game, the user can choose to watch ads for more revenue).
window.GameBridgeSDK.rewardedBreak().then((status) => {
// Invoke the completion function, where the parameter:status returns the current AD display status
});In the list of games on the management end, select the version function to perform the version list. Create a new version and submit the game pack.
Wait for the verification game, the general time is three working days
After game verification through, it will be released.