https://github.com/castle/analytics-kotlin-integration-castle
The Castle analytics-kotlin integration.
https://github.com/castle/analytics-kotlin-integration-castle
Last synced: about 1 month ago
JSON representation
The Castle analytics-kotlin integration.
- Host: GitHub
- URL: https://github.com/castle/analytics-kotlin-integration-castle
- Owner: castle
- Created: 2023-04-21T09:36:36.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-17T11:04:08.000Z (about 3 years ago)
- Last Synced: 2025-01-10T20:45:12.266Z (over 1 year ago)
- Language: Kotlin
- Size: 122 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
Awesome Lists containing this project
README
# Analytics-Kotlin Castle
Add Castle support to your applications via this plugin for [Analytics-Kotlin](https://github.com/segmentio/analytics-kotlin)
## Adding the dependency
To install the Segment-Castle integration, simply add this line to your gradle file:
```
implementation 'com.segment.analytics.kotlin.destinations:castle:'
```
Or the following for Kotlin DSL
```
implementation("com.segment.analytics.kotlin.destinations:castle:")
```
## Using the Plugin in your App
Open the file where you setup and configure the Analytics-Kotlin library. Add this plugin to the list of imports.
```
import com.segment.analytics.kotlin.destinations.castle.CastleDestination
```
Just under your Analytics-Kotlin library setup, call `analytics.add(plugin = ...)` to add an instance of the plugin to the Analytics timeline.
```
analytics = Analytics("", applicationContext) {
this.flushAt = 3
this.trackApplicationLifecycleEvents = true
}
analytics.add(plugin = CastleDestination(userJwt = ""))
```
Your events will now be automatically sent to Castle.