修改注册打点事件,将部分静态数据放在注册之前
parent
701db5bb17
commit
efc9ff9daf
|
@ -21,14 +21,34 @@ function this.Initialize()
|
|||
this.CurAccount=PlayerPrefs.GetString(this.GameName.."Account",'')
|
||||
this.CurSession=PlayerPrefs.GetString(this.GameName.."Session",'')
|
||||
|
||||
this.isRegister = false
|
||||
|
||||
SDKMgr.onRegisterCallback = function()
|
||||
-- Game.GlobalEvent:DispatchEvent(GameEvent.LoginSuccess.OnLoginSuccess,loginResp)
|
||||
ThinkingAnalyticsManager.Track("create_account")
|
||||
this.isRegister = true
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
SDKMgr.onSwitchAccountCallback = function(resp)
|
||||
|
|
|
@ -252,17 +252,10 @@ function this.SDKLogin()
|
|||
end
|
||||
end
|
||||
|
||||
function this.RefreshLoginStatus(loginResp)
|
||||
local result = string.split(loginResp, "#")
|
||||
if tonumber(result[1]) == SDK_RESULT.SUCCESS then
|
||||
function this.RefreshLoginStatus(result)
|
||||
if result == SDK_RESULT.SUCCESS then
|
||||
RequestPanel.Show(Language[11121])
|
||||
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)
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue