All-in-One Solution for Indie Game Development · Empowering Indie Developers' Dreams
📖 Documentation • 🚀 Quick Start • 💬 QQ Group
🌐 Language: English | 简体中文 | 繁體中文 | 日本語 | 한국어
CSJ (穿山甲/Pangle) platform adapter for the Game Frame X Advertisement system. This package provides rewarded video ad integration for iOS and Android apps using ByteDance's CSJ (穿山甲) advertising SDK.
- Rewarded video ad support via CSJ (穿山甲/Pangle) SDK
- Native iOS and Android platform support
- IL2CPP code stripping protection
- Conditional compilation (
UNITY_IOS,UNITY_ANDROID) - Seamless integration with the Game Frame X Advertisement component
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.
| Class | Description |
|---|---|
CSJAdvertisementManager |
Rewarded video ad manager — load, show, and lifecycle |
CSJAdvertisementConfig |
Configuration with appId and adUnitId fields |
CSJBridge |
Native bridge for iOS/Android platform calls |
CSJNativeMessageHandler |
Native message callback handler |
GameFrameXAdvertisementCSJCroppingHelper |
IL2CPP link.xml alternative — preserves type references |
- Install the Advertisement core package
- 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.csj": "https://github.com/gameframex/com.gameframex.unity.advertisement.csj.git"
}
}Or add via git URL in the Unity Package Manager window.
Configure in Unity Inspector: add the AdvertisementComponent to a GameObject, then select CSJAdvertisementManager from the implementation dropdown.
using GameFrameX.Advertisement.Runtime;
// Standard: via GameEntry (no dependency on com.gameframex.unity.entry)
var adComponent = GameEntry.GetComponent<AdvertisementComponent>();
// Set server-side verification data (optional)
adComponent.SetExtraData("userId", player.UserId);
// Play rewarded video ad
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 | Supported |
|---|---|
| iOS | Yes |
| Android | Yes |
| WebGL | No |
| Standalone | No |
Requires
UNITY_IOSorUNITY_ANDROIDscripting define symbols.
- QQ Group: Join
- GitHub Issues: Report a bug
- Initial release
- Rewarded video ad support for CSJ (穿山甲/Pangle) platform
- IL2CPP cropping protection
This project is licensed under the MIT License and Apache License 2.0.
