修改注册打点事件,将部分静态数据放在注册之前
parent
701db5bb17
commit
efc9ff9daf
|
@ -21,14 +21,34 @@ function this.Initialize()
|
||||||
this.CurAccount=PlayerPrefs.GetString(this.GameName.."Account",'')
|
this.CurAccount=PlayerPrefs.GetString(this.GameName.."Account",'')
|
||||||
this.CurSession=PlayerPrefs.GetString(this.GameName.."Session",'')
|
this.CurSession=PlayerPrefs.GetString(this.GameName.."Session",'')
|
||||||
|
|
||||||
|
this.isRegister = false
|
||||||
|
|
||||||
SDKMgr.onRegisterCallback = function()
|
SDKMgr.onRegisterCallback = function()
|
||||||
-- Game.GlobalEvent:DispatchEvent(GameEvent.LoginSuccess.OnLoginSuccess,loginResp)
|
this.isRegister = true
|
||||||
ThinkingAnalyticsManager.Track("create_account")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
SDKMgr.onLoginCallback = function(loginResp)
|
SDKMgr.onLoginCallback = function(loginResp)
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.LoginSuccess.OnLoginSuccess,loginResp)
|
-- 获取登录信息
|
||||||
-- ThinkingAnalyticsManager.Track("app_login")
|
local result = string.split(loginResp, "#")
|
||||||
|
result[1] = tonumber(result[1])
|
||||||
|
if result[1] == SDK_RESULT.SUCCESS then
|
||||||
|
AppConst.SdkId = result[2]
|
||||||
|
AppConst.OpenId = result[2]
|
||||||
|
AppConst.TokenStr = result[4]
|
||||||
|
AppConst.SdkChannel = result[5]
|
||||||
|
end
|
||||||
|
-- 判断是否是注册并登录
|
||||||
|
if this.isRegister then
|
||||||
|
this.isRegister = false
|
||||||
|
ThinkingAnalyticsManager.SetSuperProperties({
|
||||||
|
account = AppConst.isSDK and tostring(AppConst.OpenId) or "",
|
||||||
|
Bundle_id = AppConst.isSDK and AppConst.SdkPackageName or "",
|
||||||
|
xx_id = AppConst.isSDK and AppConst.SdkChannel or "",
|
||||||
|
})
|
||||||
|
ThinkingAnalyticsManager.Track("create_account")
|
||||||
|
end
|
||||||
|
-- 发送登录成功事件
|
||||||
|
Game.GlobalEvent:DispatchEvent(GameEvent.LoginSuccess.OnLoginSuccess,result[1])
|
||||||
end
|
end
|
||||||
|
|
||||||
SDKMgr.onSwitchAccountCallback = function(resp)
|
SDKMgr.onSwitchAccountCallback = function(resp)
|
||||||
|
|
|
@ -252,17 +252,10 @@ function this.SDKLogin()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.RefreshLoginStatus(loginResp)
|
function this.RefreshLoginStatus(result)
|
||||||
local result = string.split(loginResp, "#")
|
if result == SDK_RESULT.SUCCESS then
|
||||||
if tonumber(result[1]) == SDK_RESULT.SUCCESS then
|
|
||||||
RequestPanel.Show(Language[11121])
|
RequestPanel.Show(Language[11121])
|
||||||
this.SetLoginPart(true)
|
this.SetLoginPart(true)
|
||||||
AppConst.SdkId = result[2]
|
|
||||||
AppConst.OpenId = result[2]
|
|
||||||
AppConst.TokenStr = result[4]
|
|
||||||
AppConst.SdkChannel = result[5]
|
|
||||||
AppConst.SdkPackageName = AndroidDeviceInfo.Instance:GetPackageName()
|
|
||||||
-- this.SetSDKExtensionParams(result[4])
|
|
||||||
-- 获取服务器列表
|
-- 获取服务器列表
|
||||||
this.RequestServerList(AppConst.OpenId, this.OnReceiveServerList)
|
this.RequestServerList(AppConst.OpenId, this.OnReceiveServerList)
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue