Skip to content

Commit d04c402

Browse files
committed
修改错误的参数类型
1 parent eb98709 commit d04c402

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Assets/TalkingDataScripts/TalkingDataSDK.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ public static class TalkingDataSDK
163163
private static extern void TDOnTrialFinished(string profileId, string content);
164164
#endif
165165

166-
#if TD_CUSTOM
167166
[DllImport("__Internal")]
168167
private static extern void TDOnEvent(string eventId, double eventValue, string parameters);
169168

@@ -173,7 +172,6 @@ public static class TalkingDataSDK
173172
[DllImport("__Internal")]
174173
private static extern void TDRemoveGlobalKV(string key);
175174
#endif
176-
#endif
177175

178176
#if UNITY_ANDROID
179177
private static AndroidJavaObject GetCurrentActivity()
@@ -938,7 +936,10 @@ public static void SetGlobalKV(string key, object val)
938936
#if UNITY_ANDROID
939937
if (talkingdataClass != null)
940938
{
941-
talkingdataClass.CallStatic("setGlobalKV", key, val);
939+
AndroidJavaObject valObject = typeof(string).IsInstanceOfType(val)
940+
? new AndroidJavaObject("java.lang.String", val)
941+
: new AndroidJavaObject("java.lang.Double", "" + val);
942+
talkingdataClass.CallStatic("setGlobalKV", key, valObject);
942943
}
943944
#endif
944945
#if UNITY_IPHONE

0 commit comments

Comments
 (0)