You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add XElementBuilders.kt to easily build JsonObject in pure Java codebase
* bug fix
* add unit tests for XElementBuilders
* add JavaAnalytics.kt and JavaConfiguration.kt in parity with swift
* replace xson with json
* replace xson with json
* update JavaConfiguration to use builder pattern
* rename Serializable.kt to JsonSerializable.kt
* update JavaAnalytics.kt with more convenient methods
* remove unnecessary annotation
* add java compatibility to EventManipulationFunctions.kt
* bug fix
* add unit tests
* add more convenient functions for compatibility
* add a constructor to allow init with existing analytics object
* add java compat readme
* add main readme
* add comments
* bug fix
* fix merge conflicts
* add alias to JavaAnalytics.kt
* add unit test for alias
* update readme files
The alias method is used to merge two user identities, effectively connecting two sets of user data as one. This is an advanced method, but it is required to manage user identities successfully in some of our integrations.
229
+
Method signature:
230
+
```kotlin
231
+
funalias(newId:String)
232
+
```
233
+
234
+
Example Usage:
235
+
```kotlin
236
+
analytics.alias("newId")
237
+
```
238
+
221
239
### add
222
240
add API allows you to add a plugin to the analytics timeline
223
241
@@ -230,7 +248,6 @@ Example Usage:
230
248
```kotlin
231
249
val plugin =object:Plugin {
232
250
overrideval type =Plugin.Type.Enrichment
233
-
overrideval name ="SomePlugin"
234
251
overridevarlateinit analytics:Analytics
235
252
}
236
253
analytics.add(plugin)
@@ -241,25 +258,25 @@ find a registered plugin from the analytics timeline
241
258
242
259
Method signature:
243
260
```kotlin
244
-
funfind(pluginName:String): Plugin
261
+
fun<T:Plugin> find(plugin:KClass<T>): T?
245
262
```
246
263
247
264
Example Usage:
248
265
```kotlin
249
-
val plugin = analytics.find("SomePlugin")
266
+
val plugin = analytics.find(plugin::class)
250
267
```
251
268
252
269
### remove
253
270
remove a registered plugin from the analytics timeline
254
271
255
272
Method signature:
256
273
```kotlin
257
-
funremove(pluginName:String): Analytics
274
+
funremove(plugin:Plugin): Analytics
258
275
```
259
276
260
277
Example Usage:
261
278
```kotlin
262
-
analytics.remove("SomePlugin")
279
+
analytics.remove(plugin)
263
280
```
264
281
265
282
### flush
@@ -283,7 +300,6 @@ For example if you wanted to add something to the context object of any event pa
283
300
```kotlin
284
301
classSomePlugin: Plugin {
285
302
overrideval type =Plugin.Type.Enrichment
286
-
overrideval name ="SomePlugin"
287
303
288
304
overridevarlateinit analytics:Analytics
289
305
@@ -316,7 +332,7 @@ allowing you to modify/augment how events reach the particular destination.
316
332
For example if you wanted to implement a device-mode destination plugin for Amplitude
317
333
```kotlin
318
334
classAmplitudePlugin: DestinationPlugin() {
319
-
overridevalname="Amplitude"
335
+
overridevalkey="Amplitude"
320
336
321
337
val amplitudeSDK:Amplitude
322
338
@@ -351,7 +367,6 @@ analytics.add(amplitudePlugin) // add amplitudePlugin to the analytics client
0 commit comments