AD

This document describes how developers integrate Funpepper JSSDK Ads , Funpepper JS SDK provides two different ad forms: banner Video Ads and Reward Video Ads

广告接入流程

Step 1:开通【游戏开发者】资质

若已有,则忽略此步骤,
若没有,联系平台商务BD或运营。你将获得游戏商户后台:https://gameplatform.upliveapp.com的账号

Step 2:创建游戏,创建成功后通知平台,平台为游戏开通api访问权限

若之前已处理,则忽略此步骤

Step 3:使用平台提供JSSDK在游戏中接入广告

The JSSDK API of Advertising

Step1: JSSDK file

<script type="text/javascript" src="https://h-cdn.pengpengla.com/up/opengamejs/1.3.8/assets/seed.js"></script>

Step2: Initialize JSSDK

must confirm that method called openSdk.init was invoked before using other APIs openSdk provide.

Arguments

Object object

Parameter Necessary Default Description
env No pro Define current server data environment. stage:test server data environment. pro: product server data environment
client_id YES The unique id for developer, can get it from Funpepper platform
game_id YES The unique id for game, also can get it from Funpepper platform
mode YES game currency mode, two options ‘diamond/gold/ad’

Example

openSdk.init({
env: 'stage',
client_id: 'CLIENT_ID',
game_id: 'GAME_ID',
mode: 'ad' // ad mode
});

Step3: JSSDK API

Banner Video Advertising

接入广告系统的banner广告形式的游戏。需要在商户后台配置LandingPage多语言素材

  • 游戏名称
  • 游戏描述
  • 游戏截图:大小采用:202px * 358px

在游戏入口文件中调用openSdk.ads.showLandingVideo方法。用户点击“开始游戏”按钮会触发start方法

Arguments

Object object

Parameter Necessary Description
start YES callback when user click the “Start Game” button.

Example

openSdk.ads.showLandingVideo({
start: function() {
alert('进入游戏');
}
});

2、Reward Video Advertising

Video Advertising - Reward Video。The advertisement allows developers to encourage users to complete the video, so that SDK will trigger the reward conditions。When the user completes the browsing task of the incentive video,The SDK will trigger the success method to tell the developer to send the corresponding incentive

Arguments

Object object

Parameter Necessary Description
open_id YES The unique user id of Funpepper in your application
success YES When the user completes the browsing task of the incentive video,The SDK will trigger the success method to tell the developer to send the corresponding incentive
close YES The callback when the advertisement is closed。When the video is turned off when the user is not watching, the value of the return is false. When the user watches the video and hits the closing button in the introduction page, the value of the return is true.
error YES Error callback。callback when SDK can’t get the advertiserment

【注意】激励广告类型调用前提:游戏接入开放平台oAuth,接入流程详细见:文档 -> 授权

Example

openSdk.ads.showRewardVideo({
open_id: 'OPEN_ID',
success: function() {
alert('激励广告观看成功,游戏服务器端可以给予用户对应的虚拟奖励')
},
close: function(status){
if (status) {
alert('激励广告观看成功之后关闭');
} else {
alert('激励广告未观看完就关闭');
}
},
error: function() {
alert('激励广告加载失败');
}
});