Skip to content

Commit 2b7661d

Browse files
Version 1.0.19
1 parent 644fd72 commit 2b7661d

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

android-analytics/README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ This library demonstrates how you could decouple analytics libraries from your b
1414

1515
## Quick Start Guide
1616

17-
#### UPDATE: Both repo and libraries were changed. Please update your implementation!
1817
### Add To Gradle
1918
Add library to your gradle module
2019

@@ -28,19 +27,18 @@ dependencies {
2827
def version = '1.0.19'
2928
3029
31-
// add the basic analytics interface library
30+
// This is the generic java/kotlin interface
3231
compile "com.sofakingforever.analytics:analytics:version"
3332
34-
// add the basic analytics interface library
33+
// This is an android-dependant extension interface
3534
compile "com.sofakingforever.analytics:android:version@aar"
3635
37-
// then add the kits you need
36+
// then add the kits you need, or implement your own kit/dispatcher
3837
compile "com.sofakingforever.analytics:kit-answers:version@aar"
3938
compile "com.sofakingforever.analytics:kit-firebase:version@aar"
4039
compile "com.sofakingforever.analytics:kit-flurry:version@aar"
4140
compile "com.sofakingforever.analytics:kit-mixpanel:version@aar"
4241
43-
// or implement your own kit/dispatcher
4442
4543
}
4644
```
@@ -50,14 +48,17 @@ Initiate analytics and send events
5048

5149
```kotlin
5250
// init analytics
53-
analytics = Analytics(settings = AnalyticsSettings(context),
54-
FirebaseDispatcherImpl(init = true),
55-
MixPanelDispatcherImpl(init = true, projectToken = "TOKEN"),
56-
AnswersDispatcherImpl(init = true))
57-
58-
// Use this constructor for Answers if you're using crashlytics,
59-
// or any other fabric kit in addition to Answers:
60-
AnswersDispatcherImpl(init = true, Answers(), Crashlytics())
51+
analytics = Analytics(settings,
52+
CustomDispatcher(init = true),
53+
LoggerDispatcherImpl(init = true, context = this),
54+
FirebaseDispatcherImpl(init = true, context = this),
55+
MixPanelDispatcherImpl(init = true, projectToken = "TOKEN", context = this),
56+
AnswersDispatcherImpl(init = true, context = this)
57+
58+
59+
// if you're using crashlytics, or any other fabric kit in addition to Answers
60+
// AnswersDispatcherImpl(init = true, Answers(), Crashlytics())
61+
)
6162

6263
// send event
6364
analytics.track(SimpleEvent())
@@ -71,6 +72,10 @@ class SimpleEvent : CustomEvent {
7172

7273
}
7374
```
75+
### Android Highlights
76+
77+
If you're targeting Android, you need the android package, and you should generally extend
78+
`AndroidAnalyticsDispatcher` and `AndroidAnalyticsSettings` instead of the kotlin ones.
7479

7580
#### See more integration examples in the [source code](https://github.com/sofakingforever/kotlin-analytics/tree/master/app/src/main/java/com/sofakingforever/example)
7681

0 commit comments

Comments
 (0)