diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index 6cc55ab9..88327055 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -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 = { diff --git a/lua/app/common/sdk_manager.lua b/lua/app/common/sdk_manager.lua index b2c0bc4d..2c370bd4 100644 --- a/lua/app/common/sdk_manager.lua +++ b/lua/app/common/sdk_manager.lua @@ -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