2020-08-22 15:31:14 +08:00
|
|
|
|
CustomEventManager = {}
|
|
|
|
|
local this = CustomEventManager
|
2020-08-17 18:32:59 +08:00
|
|
|
|
local customEventConfig = ConfigManager.GetConfig(ConfigName.CustomEventConfig)
|
2020-08-22 15:31:14 +08:00
|
|
|
|
function this.SetisFirstLogVal(isDayFirst)
|
|
|
|
|
if isDayFirst == 0 then--今天第一次登陆
|
2020-08-17 18:32:59 +08:00
|
|
|
|
-- LogGreen("埋点上报数据 : "..CalculateSecondsNowTo_N_OClock(24).." "..GetTimeStamp().." "..PlayerManager.userCreateTime)
|
2020-08-22 15:31:14 +08:00
|
|
|
|
local cur24Times = CalculateSecondsNowTo_N_OClock(24) + GetTimeStamp()
|
|
|
|
|
local day = math.floor((cur24Times - PlayerManager.userCreateTime)/86400) + 1
|
2020-08-17 18:32:59 +08:00
|
|
|
|
-- LogGreen("day "..day)
|
2020-08-22 15:31:14 +08:00
|
|
|
|
--发送埋点数据
|
|
|
|
|
this.SendCustomEvents(FBSDKCustomEventType.LoginNum,day)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
function this.SendCustomEvents(CustomType,info)
|
2020-08-17 18:32:59 +08:00
|
|
|
|
if not AppConst.isSDKLogin then return end
|
|
|
|
|
local curConfigData = nil
|
|
|
|
|
for _, configInfo in ConfigPairs(customEventConfig) do
|
|
|
|
|
if CustomType == configInfo.CustomEventType and info == configInfo.value then
|
|
|
|
|
curConfigData = configInfo
|
2020-08-22 15:31:14 +08:00
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
end
|
2020-08-17 18:32:59 +08:00
|
|
|
|
if curConfigData then
|
|
|
|
|
if AppConst.SdkPackageName == ConfigManager.GetConfigData(ConfigName.SpecialConfig,68).Key then
|
|
|
|
|
LogGreen("埋点上报数据 成功 : "..AppConst.SdkPackageName.." "..curConfigData.tokenAndroidTest.." "..curConfigData.Info)
|
|
|
|
|
this.SendCustomEvent(curConfigData.tokenAndroidTest,curConfigData.Info,curConfigData.type)
|
|
|
|
|
elseif AppConst.SdkPackageName == ConfigManager.GetConfigData(ConfigName.SpecialConfig,69).Key then
|
|
|
|
|
LogGreen("埋点上报数据 成功 : "..AppConst.SdkPackageName.." "..curConfigData.tokenAndroidRelease.." "..curConfigData.Info)
|
|
|
|
|
this.SendCustomEvent(curConfigData.tokenAndroidRelease,curConfigData.Info,curConfigData.type)
|
|
|
|
|
elseif AppConst.SdkPackageName == ConfigManager.GetConfigData(ConfigName.SpecialConfig,70).Key then
|
|
|
|
|
LogGreen("埋点上报数据 成功 : "..AppConst.SdkPackageName.." "..curConfigData.tokenIos.." "..curConfigData.Info)
|
|
|
|
|
this.SendCustomEvent(curConfigData.tokenIos,curConfigData.Info,curConfigData.type)
|
|
|
|
|
end
|
2020-08-22 15:31:14 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- 打点事件
|
2020-08-17 18:32:59 +08:00
|
|
|
|
function this.SendCustomEvent(event, data,type)
|
|
|
|
|
-- SDKMgr:CustomEvent(event,data,type)
|
2020-08-22 15:31:14 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return CustomEventManager
|