Ad integration flow
Step 1: Developer account
If you already have one, skip. Otherwise contact BD/operations for merchant portal access: https://gameplatform.upliveapp.com
Step 2: Create game
Create the game in the portal and ask the platform to enable API access.
Step 3: Integrate JSSDK ads in your game
JSSDK ad APIs
Step1: Load JSSDK
<script type="text/javascript" src="https://h-cdn.pengpengla.com/up/opengamejs/1.4.0/assets/seed.js"></script> |
- Download: seed.js
- Demo: http://sg-oauth-demo.pengpengla.com:8000/index.html
Step2: Initialize SDK
Call openSdk.init before other APIs.
| Parameter | Required | Default | Description |
|---|---|---|---|
| env | No | pro | stage / pro |
| client_id | Yes | Application ID | |
| game_id | Yes | Game ID | |
| mode | Yes | Use ad for ads |
openSdk.init({ |
Step3: Ad APIs
Prerequisites
1) OAuth
- Server: API List
- Client: openSdk.oauth
2) PV/UV ping
1. Banner / Landing video
Configure LandingPage assets in the merchant portal (name, description, screenshots 202×358px).
Call openSdk.ads.showLandingVideo. start runs when user taps “Start game”.
| Parameter | Required | Description |
|---|---|---|
| start | Yes | Start game callback |
openSdk.ads.showLandingVideo({ |
2. Rewarded video
| Parameter | Required | Description |
|---|---|---|
| open_id | Yes | User open_id |
| success | Yes | Video completed; grant reward on server |
| close | Yes | false = early close; true = completed then closed |
| error | Yes | Load failed |
Requires OAuth. See OAuth.
Example
openSdk.ads.showRewardVideo({ |