使用topon初始化kwai广告

This commit is contained in:
juncong lee 2025-10-22 13:55:29 +08:00
parent f218790d71
commit 88918b8691
8 changed files with 123 additions and 16 deletions

5
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"recommendations": [
"visualstudiotoolsforunity.vstuc"
]
}

10
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,10 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Unity",
"type": "vstuc",
"request": "attach"
}
]
}

56
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,56 @@
{
"files.exclude": {
"**/.DS_Store": true,
"**/.git": true,
"**/.gitmodules": true,
"**/*.booproj": true,
"**/*.pidb": true,
"**/*.suo": true,
"**/*.user": true,
"**/*.userprefs": true,
"**/*.unityproj": true,
"**/*.dll": true,
"**/*.exe": true,
"**/*.pdf": true,
"**/*.mid": true,
"**/*.midi": true,
"**/*.wav": true,
"**/*.gif": true,
"**/*.ico": true,
"**/*.jpg": true,
"**/*.jpeg": true,
"**/*.png": true,
"**/*.psd": true,
"**/*.tga": true,
"**/*.tif": true,
"**/*.tiff": true,
"**/*.3ds": true,
"**/*.3DS": true,
"**/*.fbx": true,
"**/*.FBX": true,
"**/*.lxo": true,
"**/*.LXO": true,
"**/*.ma": true,
"**/*.MA": true,
"**/*.obj": true,
"**/*.OBJ": true,
"**/*.asset": true,
"**/*.cubemap": true,
"**/*.flare": true,
"**/*.mat": true,
"**/*.meta": true,
"**/*.prefab": true,
"**/*.unity": true,
"build/": true,
"Build/": true,
"Library/": true,
"library/": true,
"obj/": true,
"Obj/": true,
"ProjectSettings/": true,
"temp/": true,
"Temp/": true
},
"dotnet.defaultSolution": "SDK_UnityMoney.sln",
"git.ignoreLimitWarning": true
}

View File

@ -4,6 +4,7 @@ using BigoAds.Scripts.Platforms.Android;
using KwaiAds.Scripts.Api;
using KwaiAds.Scripts.Common;
using UnityEngine;
using WZ;
namespace KwaiAds.Scripts.Platforms.Android
{
@ -126,7 +127,10 @@ namespace KwaiAds.Scripts.Platforms.Android
{
AndroidJavaObject contextObject = currentActivity.Call<AndroidJavaObject>("getApplicationContext");
Debug.Log("Android Context: " + contextObject.Call<string>("toString"));
kwaiAdSdkClass.CallStatic("init", contextObject, sdkConfigBuilder.Call<AndroidJavaObject>("build"));
if (!KwaiAdsManager.UseToponInitKwai())
{
kwaiAdSdkClass.CallStatic("init", contextObject, sdkConfigBuilder.Call<AndroidJavaObject>("build"));
}
}
else
{

Binary file not shown.

View File

@ -47,19 +47,35 @@ namespace WZ
{
KwaiFloorIvManager.Instance.InitializeWithFloors();
}
var useToponKwai = RushSDKManager.Instance.GetRemoteConfigStr("use_topon_kwai","1").Equals("1");
LoggerUtils.Debug("KwaiAdsManager Initialize start" + _appId + " token:" + _token + " rewardAdUnitId:" + _rewardAdUnitId + " interstitialAdUnitId:" + _interstitialAdUnitId+ " useToponKwai:" + useToponKwai);
if (useToponKwai)
LoggerUtils.Debug("KwaiAdsManager Initialize start" + _appId + " token:" + _token + " rewardAdUnitId:" + _rewardAdUnitId + " interstitialAdUnitId:" + _interstitialAdUnitId + " useToponKwai:" + UseToponInitKwai());
if (UseToponInitKwai())
{
_initialized = true;
LoadInterstitial();
LoadRewarded();
if (!string.IsNullOrEmpty(_appId) && !string.IsNullOrEmpty(_token))
{
ToponKwaiUtils.InitSDK(_appId, _token, (res, msg) =>
{
LoggerUtils.Debug("KwaiAdsManager is init topon" + ToponKwaiUtils.IsInit() + " res:" + res.ToString() + " msg:" + msg);
if (res)
{
var kwaiAdConfig = new KwaiAds.Scripts.Api.KwaiAdConfig.Builder()
.SetAppId(_appId)
.SetToken(_token)
.SetDebugLog(false)
.Build();
KwaiAds.Scripts.Api.KwaiAdsSdk.Initialize(kwaiAdConfig, new InitResultCallbackImpl());
_initialized = true;
LoadInterstitial();
LoadRewarded();
}
});
}
}
else
{
LoggerUtils.Debug("KwaiAdsManager RefreshAdsData" + _appId + " token:" + _token + " rewardAdUnitId:" + _rewardAdUnitId + " interstitialAdUnitId:" + _interstitialAdUnitId+ " init:" + _initialized);
LoggerUtils.Debug("KwaiAdsManager RefreshAdsData" + _appId + " token:" + _token + " rewardAdUnitId:" + _rewardAdUnitId + " interstitialAdUnitId:" + _interstitialAdUnitId + " init:" + _initialized);
if (string.IsNullOrEmpty(_appId) || string.IsNullOrEmpty(_token) || _initialized) return;
var kwaiAdConfig = new KwaiAds.Scripts.Api.KwaiAdConfig.Builder()
.SetAppId(_appId)
@ -67,11 +83,15 @@ namespace WZ
.SetDebugLog(false)
.Build();
KwaiAds.Scripts.Api.KwaiAdsSdk.Initialize(kwaiAdConfig, new InitResultCallbackImpl());
_initialized = true;
}
KwaiAds.Scripts.Api.KwaiAdsSdk.Initialize(kwaiAdConfig, new InitResultCallbackImpl());
_initialized = true;
}
}
public static bool UseToponInitKwai()
{
return RushSDKManager.Instance.GetRemoteConfigStr("use_topon_kwai", "1").Equals("1");
}
public void RefreshAdsData()
{

View File

@ -21,7 +21,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
public static string GetSDKVersion()
{
return "1.0.4.9";
return "1.0.5.0";
}
protected override void Initialized()
{

View File

@ -1,3 +1,17 @@
# Version 1.0.5.0 2025.10.2
## Bugs
- None
## Known issues
- None
## Changelog
- 修复topon初始化kwai广告后kwai广告加载失败问题
# Version 1.0.4.9 2025.10.20
## Bugs
@ -12,8 +26,6 @@
- 修复EFSDK事件上报
# Version 1.0.4.9 2025.10.20
# Version 1.0.4.7 2025.10.17
## Bugs