@@ -38,108 +38,12 @@ internal static bool HasMigratedFrom1To2
38
38
39
39
#endregion
40
40
41
- #region HasIntegratedLibrary
42
-
43
- private const string HasIntegratedLibraryName = "Mixpanel.HasIntegratedLibrary" ;
44
-
45
- internal static bool HasIntegratedLibrary
46
- {
47
- get => Convert . ToBoolean ( PreferencesSource . GetInt ( HasIntegratedLibraryName , 0 ) ) ;
48
- set => PreferencesSource . SetInt ( HasIntegratedLibraryName , Convert . ToInt32 ( value ) ) ;
49
- }
50
-
51
- #endregion
52
-
53
- #region MPDebugInitCount
54
-
55
- private const string MPDebugInitCountName = "Mixpanel.MPDebugInitCount" ;
56
-
57
- internal static int MPDebugInitCount
58
- {
59
- get => PreferencesSource . GetInt ( MPDebugInitCountName , 0 ) ;
60
- set => PreferencesSource . SetInt ( MPDebugInitCountName , value ) ;
61
- }
62
-
63
- #endregion
64
-
65
- #region HasImplemented
66
-
67
- private const string HasImplementedName = "Mixpanel.HasImplemented" ;
68
-
69
- internal static bool HasImplemented
70
- {
71
- get => Convert . ToBoolean ( PreferencesSource . GetInt ( HasImplementedName , 0 ) ) ;
72
- set => PreferencesSource . SetInt ( HasImplementedName , Convert . ToInt32 ( value ) ) ;
73
- }
74
-
75
- #endregion
76
-
77
- #region HasTracked
78
-
79
- private const string HasTrackedName = "Mixpanel.HasTracked" ;
80
-
81
- internal static bool HasTracked
82
- {
83
- get => Convert . ToBoolean ( PreferencesSource . GetInt ( HasTrackedName , 0 ) ) ;
84
- set => PreferencesSource . SetInt ( HasTrackedName , Convert . ToInt32 ( value ) ) ;
85
- }
86
-
87
- #endregion
88
-
89
- #region HasIdentified
90
-
91
- private const string HasIdentifiedName = "Mixpanel.HasIdentified" ;
92
-
93
- internal static bool HasIdendified
94
- {
95
- get => Convert . ToBoolean ( PreferencesSource . GetInt ( HasIdentifiedName , 0 ) ) ;
96
- set => PreferencesSource . SetInt ( HasIdentifiedName , Convert . ToInt32 ( value ) ) ;
97
- }
98
-
99
- #endregion
100
-
101
- #region HasAliased
102
-
103
- private const string HasAliasedName = "Mixpanel.HasAliased" ;
104
-
105
- internal static bool HasAliased
106
- {
107
- get => Convert . ToBoolean ( PreferencesSource . GetInt ( HasAliasedName , 0 ) ) ;
108
- set => PreferencesSource . SetInt ( HasAliasedName , Convert . ToInt32 ( value ) ) ;
109
- }
110
-
111
- #endregion
112
-
113
- #region HasUsedPeople
114
-
115
- private const string HasUsedPeopleName = "Mixpanel.HasUsedPeople" ;
116
-
117
- internal static bool HasUsedPeople
118
- {
119
- get => Convert . ToBoolean ( PreferencesSource . GetInt ( HasUsedPeopleName , 0 ) ) ;
120
- set => PreferencesSource . SetInt ( HasUsedPeopleName , Convert . ToInt32 ( value ) ) ;
121
- }
122
-
123
- #endregion
124
-
125
- #region HasTrackedFirstSDKDebugLaunch
126
-
127
- private const string HasTrackedFirstSDKDebugLaunchName = "Mixpanel.HasTrackedFirstSDKDebugLaunch" ;
128
-
129
- internal static bool HasTrackedFirstSDKDebugLaunch
130
- {
131
- get => Convert . ToBoolean ( PreferencesSource . GetInt ( HasTrackedFirstSDKDebugLaunchName , 0 ) ) ;
132
- set => PreferencesSource . SetInt ( HasTrackedFirstSDKDebugLaunchName , Convert . ToInt32 ( value ) ) ;
133
- }
134
-
135
- #endregion
136
-
137
41
#region DistinctId
138
-
42
+
139
43
private const string DistinctIdName = "Mixpanel.DistinctId" ;
140
-
44
+
141
45
private static string _distinctId ;
142
-
46
+
143
47
public static string DistinctId
144
48
{
145
49
get
@@ -160,7 +64,7 @@ public static string DistinctId
160
64
PreferencesSource . SetString ( DistinctIdName , _distinctId ) ;
161
65
}
162
66
}
163
-
67
+
164
68
#endregion
165
69
166
70
#region Track
@@ -251,7 +155,7 @@ internal static Value DequeueBatchTrackingData(FlushType flushType, int batchSiz
251
155
if ( newStartIndex != oldStartIndex ) {
252
156
PreferencesSource . SetInt ( startIndexKey , newStartIndex ) ;
253
157
}
254
-
158
+
255
159
return batch ;
256
160
}
257
161
@@ -264,7 +168,7 @@ internal static void DeleteBatchTrackingData(FlushType flushType, int batchSize)
264
168
int dataIndex = oldStartIndex ;
265
169
int maxIndex = ( flushType == FlushType . EVENTS ) ? EventAutoIncrementingID ( ) - 1 : PeopleAutoIncrementingID ( ) - 1 ;
266
170
while ( deletedCount < batchSize && dataIndex <= maxIndex ) {
267
- String trackingKey = ( flushType == FlushType . EVENTS ) ? "Event" + dataIndex . ToString ( ) : "People" + dataIndex . ToString ( ) ;
171
+ String trackingKey = ( flushType == FlushType . EVENTS ) ? "Event" + dataIndex . ToString ( ) : "People" + dataIndex . ToString ( ) ;
268
172
if ( PreferencesSource . HasKey ( trackingKey ) ) {
269
173
PreferencesSource . DeleteKey ( trackingKey ) ;
270
174
deletedCount ++ ;
@@ -307,7 +211,7 @@ internal static void DeleteAllTrackingData(FlushType flushType)
307
211
#region IsTracking
308
212
309
213
private const string IsTrackingName = "Mixpanel.IsTracking" ;
310
-
214
+
311
215
private static bool _isTracking ;
312
216
313
217
public static bool IsTracking
@@ -326,9 +230,9 @@ public static bool IsTracking
326
230
}
327
231
328
232
#endregion
329
-
233
+
330
234
#region OnceProperties
331
-
235
+
332
236
private const string OncePropertiesName = "Mixpanel.OnceProperties" ;
333
237
334
238
private static Value _onceProperties ;
@@ -359,11 +263,11 @@ internal static void ResetOnceProperties()
359
263
properties . OnRecycle ( ) ;
360
264
OnceProperties = properties ;
361
265
}
362
-
266
+
363
267
#endregion
364
-
268
+
365
269
#region SuperProperties
366
-
270
+
367
271
private const string SuperPropertiesName = "Mixpanel.SuperProperties" ;
368
272
369
273
private static Value _superProperties ;
@@ -387,18 +291,18 @@ internal static Value SuperProperties
387
291
PreferencesSource . SetString ( SuperPropertiesName , JsonUtility . ToJson ( _superProperties ) ) ;
388
292
}
389
293
}
390
-
294
+
391
295
internal static void ResetSuperProperties ( )
392
296
{
393
297
Value properties = SuperProperties ;
394
298
properties . OnRecycle ( ) ;
395
299
SuperProperties = properties ;
396
300
}
397
-
301
+
398
302
#endregion
399
-
303
+
400
304
#region TimedEvents
401
-
305
+
402
306
private const string TimedEventsName = "Mixpanel.TimedEvents" ;
403
307
404
308
private static Value _timedEvents ;
@@ -409,7 +313,7 @@ internal static Value TimedEvents
409
313
{
410
314
if ( _timedEvents != null ) return _timedEvents ;
411
315
if ( ! PreferencesSource . HasKey ( TimedEventsName ) ) TimedEvents = new Value ( ) ;
412
- else
316
+ else
413
317
{
414
318
_timedEvents = new Value ( ) ;
415
319
JsonUtility . FromJsonOverwrite ( PreferencesSource . GetString ( TimedEventsName ) , _timedEvents ) ;
@@ -422,14 +326,14 @@ internal static Value TimedEvents
422
326
PreferencesSource . SetString ( TimedEventsName , JsonUtility . ToJson ( _timedEvents ) ) ;
423
327
}
424
328
}
425
-
329
+
426
330
internal static void ResetTimedEvents ( )
427
331
{
428
332
Value properties = TimedEvents ;
429
333
properties . OnRecycle ( ) ;
430
334
TimedEvents = properties ;
431
335
}
432
-
336
+
433
337
#endregion
434
338
}
435
339
}
0 commit comments