Segmenkt - The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment

Related tags

SDK Segmenkt
Overview

SegmenKT Kotlin SDK GitHub last commit



The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment. Its API is similar to the Segment Android SDK but also supports multiplatform projects, enabling you to use Segment directly from your common source targeting iOS and Android.

Installation

KMM

implementation("com.myunidays:segmenkt:0.0.1")

Android

implementation("com.myunidays:segmenkt-android:0.0.1")

iOS

Run gradle task in this project

./gradlew assembleXCFramework

Locate the framework in the following directory

build/XCFrameworks/

Add the xcframework file to your xcode project, OR you can grab it from this repo in Examples/ios/frameworks/

Important

In order for ios to work you will also need to include the segment framework to your ios project.

How to use

Initialise segment with a config

Kotlin

val segmentConfig = Configuration(
    writeKey = WriteKey(
        android = "123",
        ios = "ABC"
    ),
    context = context
)
Analytics.setupWithConfiguration(segmentConfig)

No need to define a key for iOS if you are using just Android.

Swift

let segmentConfig = Configuration(writeKey: WriteKey(android: nil, ios: ""), context: nil)
Analytics.Companion().setupWithConfiguration(configuration: segmentConfig)

Then when you want to Track, Identify, Group, Screen

Kotlin

Analytics.shared().track("Cool Event")
Analytics.shared().identify("1")
Analytics.shared().group("1")
Analytics.shared().screen("Cool Screen")

Swift

Analytics.Companion().shared(context: nil).track(name: "Cool Event", properties: nil)
Analytics.Companion().shared(context: nil).identify(userId: "1", traits: nil)
Analytics.Companion().shared(context: nil).group(groupId: "1", traits: nil)
Analytics.Companion().shared(context: nil).screen(screenTitle: "Cool Screen", properties: nil)

Examples

Run the examples from the examples directory for KMM, Android and iOS

Contributing

This project is set up as an open source project. As such, if there are any suggestions that you have for features, for improving the code itself, or you have come across any problems; you can raise them and/or suggest changes in implementation.

If you are interested in contributing to this codebase, please follow the contributing guidelines. This contains guides on both contributing directly and raising feature requests or bug reports. Please adhere to our code of conduct when doing any of the above.

You might also like...
Java/Kotlin WE contract SDK.

we-contract-sdk Java/Kotlin contract SDK used for building Docker smart contracts. All transaction handling is done via methods of a single class mark

Android Word/Letter Tracing SDK is a complet solution to build apps for kids learning in pure kotlin
Android Word/Letter Tracing SDK is a complet solution to build apps for kids learning in pure kotlin

Android Word/Letter Tracing SDK is a complet solution to build apps for kids learning in pure kotlin. It supports all kind of shapes and all language letters e.g. english, arabic, Urdu, hindi etc.

AWS SDK for Android. For more information, see our web site:

AWS SDK for Android For new projects, we recommend interacting with AWS using the Amplify Framework. The AWS SDK for Android is a collection of low-le

Countly Product Analytics Android SDK
Countly Product Analytics Android SDK

Countly Android SDK We're hiring: Countly is looking for Android SDK developers, full stack devs, devops and growth hackers (remote work). Click this

Android Real Time Chat & Messaging SDK
Android Real Time Chat & Messaging SDK

Android Chat SDK Overview Applozic brings real-time engagement with chat, video, and voice to your web, mobile, and conversational apps. We power emer

Evernote SDK for Android

Evernote SDK for Android version 2.0.0-RC4 Evernote API version 1.25 Overview This SDK wraps the Evernote Cloud API and provides OAuth authentication

Air Native Extension (iOS and Android) for the Facebook mobile SDK

Air Native Extension for Facebook (iOS + Android) This is an AIR Native Extension for the Facebook SDK on iOS and Android. It has been developed by Fr

Android Chat SDK built on Firebase
Android Chat SDK built on Firebase

Chat21 is the core of the open source live chat platform Tiledesk.com. Chat21 SDK Documentation Features With Chat21 Android SDK you can: Send a direc

Liquid SDK (Android)

Liquid Android SDK Quick Start to Liquid SDK for Android This document is just a quick start introduction to Liquid SDK for Android. We recommend you

Releases(0.0.9)
Owner
UNiDAYS
UNiDAYS
Sdk-android - SnapOdds Android SDK

Documentation For the full API documentation go to https://snapodds.github.io/sd

Snapodds 0 Jan 30, 2022
Frogo SDK - SDK Core for Easy Development

SDK for anything your problem to make easier developing android apps

Frogobox 10 Dec 15, 2022
Its measurement app made using kotlin with sceneform sdk by google

ARCORE MEASUREMENT This app is build using sceneform sdk for android using kotlin language It helps you measure the distance between multiple points i

Kashif Mehmood 39 Dec 9, 2022
Storyblok Kotlin Multiplatform SDK sample (Android, JVM, JS)

storyblok-mp-SDK-sample *WIP* ... a showcase of the Storyblok Kotlin Multiplatform Client SDK. (Android, JVM, JS, iOS, ...) What's included ?? • About

Mike Penz 6 Jan 8, 2022
Kotlin Multi Platform SDK

Xeon SDK (work-in-progress ?? ??️ ??‍♀️ ⛏ ) Development Version Release This Is Latest Release ~ In Development $version_release = ~ What's New?? * I

Frogobox 3 Oct 15, 2021
NextPay Kotlin SDK

Welcome to nextpay-kt ?? Connect to NextPay.ir payment gateway in easy way. ?? Homepage Setup Kotlin KTS 1- Add mavenCentral() to your repositories se

Farhad 5 Nov 6, 2021
WalletConnect Kotlin SDK v2

WalletConnect V2 - Kotlin Kotlin implementation of WalletConnect v2 protocol for Android applications. Requirements Android min SDK 21 Java 11 Install

WalletConnect Labs 11 Dec 22, 2021
Official Appwrite Kotlin SDK 💙🧡

Appwrite Kotlin SDK This SDK is compatible with Appwrite server version 0.11.x. For older versions, please check previous releases. This is the Kotlin

Appwrite 47 Nov 26, 2022
Streem Server SDK for Java & Kotlin

Streem Server SDK for Java & Kotlin Server-side JVM library for interacting with the Streem API, and generation of Streem Tokens for use in client SDK

Streem, Inc. 1 Dec 15, 2022
Implement a Casper Kotlin SDK to interact with the Casper network.

CSPR-Kotlin-SDK Kotlin SDK library for interacting with a CSPR node. What is CSPR-Kotlin-SDK? SDK to streamline the 3rd party Kotlin client integratio

null 2 Mar 28, 2022