adjust sdk

This commit is contained in:
chenxi 2023-06-14 19:11:34 +08:00
parent 972a339c4a
commit f522757923
4 changed files with 51 additions and 12 deletions

View File

@ -31,7 +31,8 @@ namespace com.adjust.sdk
EditorGUILayout.Space();
EditorGUILayout.LabelField("MULTIPLATFORM SETTINGS:", darkerCyanTextFieldStyles);
EditorGUI.indentLevel += 1;
adjust.appToken = EditorGUILayout.TextField("App Token", adjust.appToken);
adjust.androidAppToken = EditorGUILayout.TextField("Android App Token", adjust.androidAppToken);
adjust.iosAppToken = EditorGUILayout.TextField("IOS App Token", adjust.iosAppToken);
adjust.environment = (AdjustEnvironment)EditorGUILayout.EnumPopup("Environment", adjust.environment);
adjust.logLevel = (AdjustLogLevel)EditorGUILayout.EnumPopup("Log Level", adjust.logLevel);
adjust.urlStrategy = (AdjustUrlStrategy)EditorGUILayout.EnumPopup("URL Strategy", adjust.urlStrategy);

View File

@ -17,7 +17,9 @@ namespace com.adjust.sdk
[HideInInspector]
public bool startManually = true;
[HideInInspector]
public string appToken;
public string androidAppToken;
[HideInInspector]
public string iosAppToken;
[HideInInspector]
public AdjustEnvironment environment = AdjustEnvironment.Sandbox;
[HideInInspector]
@ -109,7 +111,11 @@ namespace com.adjust.sdk
if (!this.startManually)
{
AdjustConfig adjustConfig = new AdjustConfig(this.appToken, this.environment, (this.logLevel == AdjustLogLevel.Suppress));
#if UNITY_IOS && !UNITY_EDITOR
AdjustConfig adjustConfig = new AdjustConfig(this.iosAppToken, this.environment, (this.logLevel == AdjustLogLevel.Suppress));
#else
AdjustConfig adjustConfig = new AdjustConfig(this.androidAppToken, this.environment, (this.logLevel == AdjustLogLevel.Suppress));
#endif
adjustConfig.setLogLevel(this.logLevel);
adjustConfig.setSendInBackground(this.sendInBackground);
adjustConfig.setEventBufferingEnabled(this.eventBuffering);

View File

@ -21,12 +21,13 @@ namespace XLua.CSObjectWrap
{
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
System.Type type = typeof(com.adjust.sdk.Adjust);
Utils.BeginObjectRegister(type, L, translator, 0, 0, 25, 25);
Utils.BeginObjectRegister(type, L, translator, 0, 0, 26, 26);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "startManually", _g_get_startManually);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "appToken", _g_get_appToken);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "androidAppToken", _g_get_androidAppToken);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "iosAppToken", _g_get_iosAppToken);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "environment", _g_get_environment);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "logLevel", _g_get_logLevel);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "eventBuffering", _g_get_eventBuffering);
@ -52,7 +53,8 @@ namespace XLua.CSObjectWrap
Utils.RegisterFunc(L, Utils.GETTER_IDX, "skAdNetworkHandling", _g_get_skAdNetworkHandling);
Utils.RegisterFunc(L, Utils.SETTER_IDX, "startManually", _s_set_startManually);
Utils.RegisterFunc(L, Utils.SETTER_IDX, "appToken", _s_set_appToken);
Utils.RegisterFunc(L, Utils.SETTER_IDX, "androidAppToken", _s_set_androidAppToken);
Utils.RegisterFunc(L, Utils.SETTER_IDX, "iosAppToken", _s_set_iosAppToken);
Utils.RegisterFunc(L, Utils.SETTER_IDX, "environment", _s_set_environment);
Utils.RegisterFunc(L, Utils.SETTER_IDX, "logLevel", _s_set_logLevel);
Utils.RegisterFunc(L, Utils.SETTER_IDX, "eventBuffering", _s_set_eventBuffering);
@ -1091,13 +1093,27 @@ namespace XLua.CSObjectWrap
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _g_get_appToken(RealStatePtr L)
static int _g_get_androidAppToken(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
com.adjust.sdk.Adjust gen_to_be_invoked = (com.adjust.sdk.Adjust)translator.FastGetCSObj(L, 1);
LuaAPI.lua_pushstring(L, gen_to_be_invoked.appToken);
LuaAPI.lua_pushstring(L, gen_to_be_invoked.androidAppToken);
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
return 1;
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _g_get_iosAppToken(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
com.adjust.sdk.Adjust gen_to_be_invoked = (com.adjust.sdk.Adjust)translator.FastGetCSObj(L, 1);
LuaAPI.lua_pushstring(L, gen_to_be_invoked.iosAppToken);
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
@ -1444,13 +1460,28 @@ namespace XLua.CSObjectWrap
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _s_set_appToken(RealStatePtr L)
static int _s_set_androidAppToken(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
com.adjust.sdk.Adjust gen_to_be_invoked = (com.adjust.sdk.Adjust)translator.FastGetCSObj(L, 1);
gen_to_be_invoked.appToken = LuaAPI.lua_tostring(L, 2);
gen_to_be_invoked.androidAppToken = LuaAPI.lua_tostring(L, 2);
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
return 0;
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _s_set_iosAppToken(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
com.adjust.sdk.Adjust gen_to_be_invoked = (com.adjust.sdk.Adjust)translator.FastGetCSObj(L, 1);
gen_to_be_invoked.iosAppToken = LuaAPI.lua_tostring(L, 2);
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);

View File

@ -210,7 +210,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
startManually: 0
appToken: asezin7bs3r4
androidAppToken: 68zm6p28yglc
iosAppToken: asezin7bs3r4
environment: 1
logLevel: 3
eventBuffering: 0
@ -461,7 +462,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 2a2ec6ba1ee8b48749524f015ed572a6, type: 3}
m_Name:
m_EditorClassIdentifier:
devKey: XHsvoUhhNvMamKMSEvrew3
devKey: HsaU4uaFpWe6QuK9px6Uz4
iosDevKey: R4qWrbCEhSQRBgeQVvGHQ9
appID: 6450101181
UWPAppID: