logo
0
0
WeChat Login
docs(readme): add GameApp shortcut usage examples

GameFrameX Logo

Game Frame X Advertisement (Alipay Mini Game)

Version License Documentation

All-in-One Solution for Indie Game Development · Empowering Indie Developers' Dreams

📖 Documentation🚀 Quick Start💬 QQ Group


🌐 Language: English | 简体中文 | 繁體中文 | 日本語 | 한국어


Project Overview

Alipay Mini Game platform adapter for the Game Frame X Advertisement system. This package provides rewarded video ad integration for games published on the Alipay Mini Game platform.

Features

  • Rewarded video ad support via Alipay SDK
  • Automatic ad loading with show-failure retry
  • IL2CPP code stripping protection
  • Conditional compilation (ENABLE_ALIPAY_MINI_GAME, ENABLE_ALIPAY_MINI_GAME_ADVERTISEMENT)
  • Seamless integration with the Game Frame X Advertisement component

Architecture

This package is an adapter implementation of BaseAdvertisementManager from the Game Frame X Advertisement core. It is discovered and loaded automatically by AdvertisementComponent via Unity Inspector configuration.

ClassDescription
AliPayMiniGameAdvertisementManagerRewarded video ad manager — load, show, and lifecycle
AliPayVideoAdCallbackCallback handler for ad load/show events
GameFrameXAdvertisementAliPayMiniGameCroppingHelperIL2CPP link.xml alternative — preserves type references

Quick Start

Installation

  1. Install the Advertisement core package
  2. Add this adapter via Unity Package Manager (UPM):
{
  "dependencies": {
    "com.gameframex.unity.advertisement": "https://github.com/GameFrameX/com.gameframex.unity.advertisement.git",
    "com.gameframex.unity.advertisement.alipayminigame": "https://github.com/GameFrameX/com.gameframex.unity.advertisement.alipayminigame.git"
  }
}

Or add via git URL in the Unity Package Manager window.

Usage

Configure in Unity Inspector: add the AdvertisementComponent to a GameObject, then select AliPayMiniGameAdvertisementManager from the implementation dropdown.

using GameFrameX.Advertisement.Runtime;

// Standard: via GameEntry (no dependency on com.gameframex.unity.entry)
var adComponent = GameEntry.GetComponent<AdvertisementComponent>();
adComponent.SetExtraData("userId", player.UserId);
var option = new AdvertisementPlayOption
{
    OnSuccess    = (data) => Debug.Log("Ad shown successfully"),
    OnFail       = (err) => Debug.LogError($"Ad failed: {err}"),
    OnShowResult = (watched) =>
    {
        if (watched)
        {
            // Reward the user
        }
    },
};
adComponent.Play(option);

// Shortcut: via GameApp (requires com.gameframex.unity.entry)
GameApp.Advertisement.SetExtraData("userId", player.UserId);
var option2 = new AdvertisementPlayOption
{
    OnSuccess    = (data) => Debug.Log("Ad shown successfully"),
    OnFail       = (err) => Debug.LogError($"Ad failed: {err}"),
    OnShowResult = (watched) =>
    {
        if (watched)
        {
            // Reward the user
        }
    },
};
GameApp.Advertisement.Play(option2);

Platform Support

PlatformSupported
Alipay Mini Game (WebGL)Yes
AndroidNo
iOSNo
StandaloneNo

Requires UNITY_WEBGL and ENABLE_ALIPAY_MINI_GAME scripting define symbols.

Documentation & Resources

Community & Support

Changelog

v1.0.0

  • Initial release
  • Rewarded video ad support for Alipay Mini Game platform
  • IL2CPP cropping protection

License

This project is licensed under the MIT License and Apache License 2.0.