Skip to content

Commit 4926b6c

Browse files
committed
[修改]1. 修改SDK异常
1 parent ce98b09 commit 4926b6c

7 files changed

Lines changed: 95 additions & 71 deletions

Runtime/TalkingDataOrder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ public override string ToString()
6868
}
6969
#endif
7070
}
71-
#endif
71+
#endif

Runtime/TalkingDataProfile.cs

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
11
using UnityEngine;
22

33

4+
/// <summary>
5+
/// 用户类型
6+
/// </summary>
47
public enum TalkingDataProfileType
58
{
6-
ANONYMOUS = 0,
7-
REGISTERED = 1,
8-
SINA_WEIBO = 2,
9-
QQ = 3,
10-
QQ_WEIBO = 4,
11-
ND91 = 5,
12-
WEIXIN = 6,
13-
TYPE1 = 11,
14-
TYPE2 = 12,
15-
TYPE3 = 13,
16-
TYPE4 = 14,
17-
TYPE5 = 15,
18-
TYPE6 = 16,
19-
TYPE7 = 17,
20-
TYPE8 = 18,
21-
TYPE9 = 19,
22-
TYPE10 = 20
9+
ANONYMOUS = 0,
10+
REGISTERED = 1,
11+
SINA_WEIBO = 2,
12+
QQ = 3,
13+
QQ_WEIBO = 4,
14+
ND91 = 5,
15+
WEIXIN = 6,
16+
TYPE1 = 11,
17+
TYPE2 = 12,
18+
TYPE3 = 13,
19+
TYPE4 = 14,
20+
TYPE5 = 15,
21+
TYPE6 = 16,
22+
TYPE7 = 17,
23+
TYPE8 = 18,
24+
TYPE9 = 19,
25+
TYPE10 = 20
2326
}
2427

2528

29+
/// <summary>
30+
/// 性别
31+
/// </summary>
2632
public enum TalkingDataGender
2733
{
28-
UNKNOWN = 0,
29-
MALE = 1,
30-
FEMALE = 2
34+
UNKNOWN = 0,
35+
MALE = 1,
36+
FEMALE = 2
3137
}
3238

3339

@@ -65,6 +71,7 @@ public static TalkingDataProfile CreateProfile()
6571
#endif
6672
return profile;
6773
}
74+
6875
return null;
6976
}
7077

@@ -83,6 +90,7 @@ public TalkingDataProfile SetName(string name)
8390
this.name = name;
8491
#endif
8592
}
93+
8694
return this;
8795
}
8896

@@ -103,6 +111,7 @@ public TalkingDataProfile SetType(TalkingDataProfileType type)
103111
this.type = type;
104112
#endif
105113
}
114+
106115
return this;
107116
}
108117

@@ -123,6 +132,7 @@ public TalkingDataProfile SetGender(TalkingDataGender gender)
123132
this.gender = gender;
124133
#endif
125134
}
135+
126136
return this;
127137
}
128138

@@ -141,6 +151,7 @@ public TalkingDataProfile SetAge(int age)
141151
this.age = age;
142152
#endif
143153
}
154+
144155
return this;
145156
}
146157

@@ -160,6 +171,7 @@ public TalkingDataProfile SetProperty1(object property)
160171
this.property1 = property;
161172
#endif
162173
}
174+
163175
return this;
164176
}
165177

@@ -179,6 +191,7 @@ public TalkingDataProfile SetProperty2(object property)
179191
this.property2 = property;
180192
#endif
181193
}
194+
182195
return this;
183196
}
184197

@@ -198,6 +211,7 @@ public TalkingDataProfile SetProperty3(object property)
198211
this.property3 = property;
199212
#endif
200213
}
214+
201215
return this;
202216
}
203217

@@ -217,6 +231,7 @@ public TalkingDataProfile SetProperty4(object property)
217231
this.property4 = property;
218232
#endif
219233
}
234+
220235
return this;
221236
}
222237

@@ -236,6 +251,7 @@ public TalkingDataProfile SetProperty5(object property)
236251
this.property5 = property;
237252
#endif
238253
}
254+
239255
return this;
240256
}
241257

@@ -255,6 +271,7 @@ public TalkingDataProfile SetProperty6(object property)
255271
this.property6 = property;
256272
#endif
257273
}
274+
258275
return this;
259276
}
260277

@@ -274,6 +291,7 @@ public TalkingDataProfile SetProperty7(object property)
274291
this.property7 = property;
275292
#endif
276293
}
294+
277295
return this;
278296
}
279297

@@ -293,6 +311,7 @@ public TalkingDataProfile SetProperty8(object property)
293311
this.property8 = property;
294312
#endif
295313
}
314+
296315
return this;
297316
}
298317

@@ -312,6 +331,7 @@ public TalkingDataProfile SetProperty9(object property)
312331
this.property9 = property;
313332
#endif
314333
}
334+
315335
return this;
316336
}
317337

@@ -331,6 +351,7 @@ public TalkingDataProfile SetProperty10(object property)
331351
this.property10 = property;
332352
#endif
333353
}
354+
334355
return this;
335356
}
336357

@@ -366,6 +387,7 @@ private AndroidJavaObject AndroidJavaObjectFromObject(object parameter)
366387
{
367388
androidObject = new AndroidJavaObject("java.lang.Double", parameter);
368389
}
390+
369391
return androidObject;
370392
}
371393
#endif
@@ -465,4 +487,4 @@ public override string ToString()
465487
return null;
466488
}
467489
#endif
468-
}
490+
}

Runtime/TalkingDataSDK.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
using System.Runtime.InteropServices;
1111
using System.Collections;
1212
#endif
13-
14-
1513
public static class TalkingDataSDK
1614
{
1715
#if UNITY_ANDROID

Runtime/TalkingDataSDKConfig.cs

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,74 +7,75 @@ public class TalkingDataSDKConfig
77

88
public static TalkingDataSDKConfig CreateConfig()
99
{
10-
if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor)
11-
{
12-
TalkingDataSDKConfig config = new TalkingDataSDKConfig();
13-
#if UNITY_ANDROID
14-
config.javaObj = new AndroidJavaObject("com.tendcloud.tenddata.TalkingDataSDKConfig");
10+
var config = new TalkingDataSDKConfig();
11+
#if UNITY_ANDROID || !UNITY_EDITOR
12+
config.javaObj = new AndroidJavaObject("com.tendcloud.tenddata.TalkingDataSDKConfig");
1513
#endif
16-
return config;
17-
}
18-
return null;
14+
return config;
1915
}
2016

17+
/// <summary>
18+
/// 是否 允许收集IMEI和MEID
19+
/// </summary>
20+
/// <param name="enabled"></param>
21+
/// <returns></returns>
2122
public TalkingDataSDKConfig SetIMEIAndMEIDEnabled(bool enabled)
2223
{
23-
if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor)
24-
{
25-
#if UNITY_ANDROID
26-
javaObj.Call<AndroidJavaObject>("setIMEIAndMEIDEnabled", enabled);
24+
#if UNITY_ANDROID || !UNITY_EDITOR
25+
javaObj.Call<AndroidJavaObject>("setIMEIAndMEIDEnabled", enabled);
2726
#endif
28-
return this;
29-
}
30-
return null;
27+
return this;
3128
}
3229

30+
/// <summary>
31+
/// 是否 允许收集MAC
32+
/// </summary>
33+
/// <param name="enabled"></param>
34+
/// <returns></returns>
3335
public TalkingDataSDKConfig SetMACEnabled(bool enabled)
3436
{
35-
if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor)
36-
{
37-
#if UNITY_ANDROID
38-
javaObj.Call<AndroidJavaObject>("setMACEnabled", enabled);
37+
#if UNITY_ANDROID || !UNITY_EDITOR
38+
javaObj.Call<AndroidJavaObject>("setMACEnabled", enabled);
3939
#endif
40-
return this;
41-
}
42-
return null;
40+
return this;
4341
}
4442

43+
/// <summary>
44+
/// 是否 允许收集应用列表
45+
/// </summary>
46+
/// <param name="enabled"></param>
47+
/// <returns></returns>
4548
public TalkingDataSDKConfig SetAppListEnabled(bool enabled)
4649
{
47-
if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor)
48-
{
49-
#if UNITY_ANDROID
50-
javaObj.Call<AndroidJavaObject>("setAppListEnabled", enabled);
50+
#if UNITY_ANDROID || !UNITY_EDITOR
51+
javaObj.Call<AndroidJavaObject>("setAppListEnabled", enabled);
5152
#endif
52-
return this;
53-
}
54-
return null;
53+
return this;
5554
}
5655

56+
/// <summary>
57+
/// 是否 允许收集位置信息
58+
/// </summary>
59+
/// <param name="enabled"></param>
60+
/// <returns></returns>
5761
public TalkingDataSDKConfig SetLocationEnabled(bool enabled)
5862
{
59-
if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor)
60-
{
61-
#if UNITY_ANDROID
62-
javaObj.Call<AndroidJavaObject>("setLocationEnabled", enabled);
63+
#if UNITY_ANDROID || !UNITY_EDITOR
64+
javaObj.Call<AndroidJavaObject>("setLocationEnabled", enabled);
6365
#endif
64-
return this;
65-
}
66-
return null;
66+
return this;
6767
}
6868

69+
/// <summary>
70+
/// 是否 允许收集网络信息
71+
/// </summary>
72+
/// <param name="enabled"></param>
73+
/// <returns></returns>
6974
public TalkingDataSDKConfig SetWifiEnabled(bool enabled)
7075
{
71-
if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor)
72-
{
73-
#if UNITY_ANDROID
74-
javaObj.Call<AndroidJavaObject>("setWifiEnabled", enabled);
76+
#if UNITY_ANDROID || !UNITY_EDITOR
77+
javaObj.Call<AndroidJavaObject>("setWifiEnabled", enabled);
7578
#endif
76-
return this;
77-
}
78-
return null;
79+
return this;
7980
}
80-
}
81+
}

Runtime/TalkingDataSearch.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public static TalkingDataSearch CreateSearch()
3333
#endif
3434
return search;
3535
}
36+
3637
return null;
3738
}
3839

@@ -51,6 +52,7 @@ public TalkingDataSearch SetCategory(string category)
5152
this.category = category;
5253
#endif
5354
}
55+
5456
return this;
5557
}
5658

@@ -69,6 +71,7 @@ public TalkingDataSearch SetContent(string content)
6971
this.content = content;
7072
#endif
7173
}
74+
7275
return this;
7376
}
7477

@@ -207,4 +210,4 @@ public override string ToString()
207210
return null;
208211
}
209212
#endif
210-
}
213+
}

Runtime/TalkingDataShoppingCart.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ public override string ToString()
6060
}
6161
#endif
6262
}
63-
#endif
63+
#endif

Runtime/TalkingDataTransaction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,4 @@ public override string ToString()
217217
}
218218
#endif
219219
}
220-
#endif
220+
#endif

0 commit comments

Comments
 (0)