【数数】尝试使用数数的设备id
parent
47a90b60c5
commit
606b98aadd
|
@ -119,7 +119,12 @@ namespace GameLogic
|
||||||
Dictionary<string, object> data = stringToDic(trackData);
|
Dictionary<string, object> data = stringToDic(trackData);
|
||||||
ThinkingAnalyticsAPI.Track(trackEvent, data);
|
ThinkingAnalyticsAPI.Track(trackEvent, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设置访客Id
|
||||||
|
public string GetDeviceId()
|
||||||
|
{
|
||||||
|
return ThinkingAnalyticsAPI.GetDeviceId();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Debug.Log("TA.TAExample - current disctinct ID is: " + ThinkingAnalyticsAPI.GetDistinctId());
|
// Debug.Log("TA.TAExample - current disctinct ID is: " + ThinkingAnalyticsAPI.GetDistinctId());
|
||||||
|
|
|
@ -68,6 +68,17 @@ function this.GetDistinctId()
|
||||||
end
|
end
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
-- 获取设备Id
|
||||||
|
function this.GetDeviceId()
|
||||||
|
if AppConst.isSDK then
|
||||||
|
if App.TAMgr.GetDeviceID then
|
||||||
|
return App.TAMgr:GetDeviceId()
|
||||||
|
end
|
||||||
|
return AndroidDeviceInfo.Instance:GetDeviceID()
|
||||||
|
end
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- 登录
|
-- 登录
|
||||||
function this.Login(accountId)
|
function this.Login(accountId)
|
||||||
|
|
|
@ -49,7 +49,7 @@ function this.Initialize()
|
||||||
account = AppConst.isSDK and tostring(AppConst.OpenId) or "",
|
account = AppConst.isSDK and tostring(AppConst.OpenId) or "",
|
||||||
Bundle_id = AppConst.isSDK and AppConst.SdkPackageName or "",
|
Bundle_id = AppConst.isSDK and AppConst.SdkPackageName or "",
|
||||||
xx_id = AppConst.isSDK and AppConst.SdkChannel or "",
|
xx_id = AppConst.isSDK and AppConst.SdkChannel or "",
|
||||||
device_id = AppConst.isSDK and AndroidDeviceInfo.Instance:GetDeviceID() or ""
|
device_id = AppConst.isSDK and ThinkingAnalyticsManager.GetDeviceId() or ""
|
||||||
})
|
})
|
||||||
ThinkingAnalyticsManager.Track("create_account")
|
ThinkingAnalyticsManager.Track("create_account")
|
||||||
end
|
end
|
||||||
|
|
|
@ -33,7 +33,7 @@ end
|
||||||
--请求登录
|
--请求登录
|
||||||
function this.LoginRequest(openId, func)
|
function this.LoginRequest(openId, func)
|
||||||
local data = PlayerInfoProto_pb.LoginRequest()
|
local data = PlayerInfoProto_pb.LoginRequest()
|
||||||
data.device_id_s = AppConst.isSDK and AndroidDeviceInfo.Instance:GetDeviceID() or ""
|
data.device_id_s = AppConst.isSDK and ThinkingAnalyticsManager.GetDeviceId() or ""
|
||||||
data.idfa_sOr_imei_s = AppConst.isSDK and AndroidDeviceInfo.Instance:GetIMEICode() or ""
|
data.idfa_sOr_imei_s = AppConst.isSDK and AndroidDeviceInfo.Instance:GetIMEICode() or ""
|
||||||
data.brand_type_s = AppConst.isSDK and AndroidDeviceInfo.Instance:GetDeviceBrand() or ""
|
data.brand_type_s = AppConst.isSDK and AndroidDeviceInfo.Instance:GetDeviceBrand() or ""
|
||||||
data.brand_s = AppConst.isSDK and AndroidDeviceInfo.Instance:GetDeviceModel() or ""
|
data.brand_s = AppConst.isSDK and AndroidDeviceInfo.Instance:GetDeviceModel() or ""
|
||||||
|
|
|
@ -17,6 +17,7 @@ public class GameLogic_ThinkingAnalyticsManagerWrap
|
||||||
L.RegFunction("SetSuperProperties", SetSuperProperties);
|
L.RegFunction("SetSuperProperties", SetSuperProperties);
|
||||||
L.RegFunction("ClearSuperProperties", ClearSuperProperties);
|
L.RegFunction("ClearSuperProperties", ClearSuperProperties);
|
||||||
L.RegFunction("Track", Track);
|
L.RegFunction("Track", Track);
|
||||||
|
L.RegFunction("GetDeviceId", GetDeviceId);
|
||||||
L.RegFunction("__eq", op_Equality);
|
L.RegFunction("__eq", op_Equality);
|
||||||
L.RegFunction("__tostring", ToLua.op_ToString);
|
L.RegFunction("__tostring", ToLua.op_ToString);
|
||||||
L.EndClass();
|
L.EndClass();
|
||||||
|
@ -190,6 +191,23 @@ public class GameLogic_ThinkingAnalyticsManagerWrap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||||
|
static int GetDeviceId(IntPtr L)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ToLua.CheckArgsCount(L, 1);
|
||||||
|
GameLogic.ThinkingAnalyticsManager obj = (GameLogic.ThinkingAnalyticsManager)ToLua.CheckObject<GameLogic.ThinkingAnalyticsManager>(L, 1);
|
||||||
|
string o = obj.GetDeviceId();
|
||||||
|
LuaDLL.lua_pushstring(L, o);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return LuaDLL.toluaL_exception(L, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||||
static int op_Equality(IntPtr L)
|
static int op_Equality(IntPtr L)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue