广告价值回传上报

This commit is contained in:
chenxi 2023-07-19 09:49:49 +08:00
parent be2e185a77
commit e20311211e
2 changed files with 23 additions and 0 deletions

View File

@ -257,6 +257,7 @@ local EVENT_NAME_PAY_UI_SHOW = "client_pay_ui_show" -- 内购相关界面展示
local EVENT_NAME_BOUNTY_OPT = "client_bounty_opt" -- 通用战令事件(包括常规,竞技场等)
local EVENT_NAME_NETWORK_OPT = "client_network_opt" -- 网络操作
local EVENT_NAME_APPLOVIN_AD_REVENUE = "client_applovin_ad_revenue" -- applovin广告收入
local EVENT_NAME_IRONSOURCE_AD_REVENUE = "client_ironsource_ad_revenue" -- applovin广告收入
local EVENT_NAME_DAILY_CHALLENGE_OPT = "client_daily_challenge_opt"
local EVENT_NAME_ARENA_OPT = "client_arena_opt"-- 竞技场
local EVENT_NAME_MISCELLANEOUS_OPT = "event_name_miscellaneous_opt" -- 一些杂项
@ -1441,6 +1442,23 @@ function BIReport:postAppLovinAdRevenue(msg)
end
end
function BIReport:postIronSourceAdRevenue(msg)
local args = json.decode(msg) or {}
if args.revenue then
args.revenue = tonumber(args.revenue)
end
if args.lifetime_revenue then
args.lifetime_revenue = tonumber(args.lifetime_revenue)
end
self:report(EVENT_NAME_IRONSOURCE_AD_REVENUE, args)
if args.revenue then
local args2 = {
ironsource_revenue = args.revenue
}
self:postFirebaseLog("ad_impression", args2)
end
end
-- 竞技场进入消耗上报
function BIReport:postArenaConsume(gradingId, todayConsume)
local args = {

View File

@ -275,6 +275,11 @@ function SDKManager:initAdsListener()
self.adCallback = nil
end
end)
CS.BF.BFMain.Instance.SDKMgr.BFIronSourceSDKMgr:SetAdRevenuePaidEventCallback(function (result)
if result and result ~= GConst.EMPTY_STRING then
BIReport:postIronSourceAdRevenue(result)
end
end)
elseif CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer then
-- 初始化一下
local adManager = CS.AdManager.Instance