notifly-core-sdk
v2.21.0
Published
Shared Kotlin Multiplatform implementation used by the Notifly SDKs
Downloads
861
Readme
[!NOTE] This repository contains shared source code. Each platform SDK builds and distributes its own Core and Full packages. Application developers can install either the Full SDK or the platform's Core package.
Purpose
This module provides a shared implementation for behavior that should remain consistent across the Notifly SDKs. It reduces duplicated business logic while leaving platform integration and customer-facing SDK ownership with each platform repository.
This README covers the module's purpose, architectural boundaries, and contributor conventions. Keep individual feature descriptions and API usage examples in source-level documentation rather than maintaining a feature catalog here.
Architecture
flowchart TB
KMP["notifly-kmp-sdk<br/>Shared source code"]
Android["Android SDK<br/>Core JAR + Full AAR"]
iOS["iOS SDK<br/>Core XCFramework + Full Swift sources"]
JS["JavaScript SDK<br/>Core + Full packages"]
RN["React Native SDK"]
Flutter["Flutter SDK"]
KMP --> Android
KMP --> iOS
KMP --> JS
Android --> RN
iOS --> RN
Android --> Flutter
iOS --> Flutter
JS -->|Web| FlutterThe library is one Gradle module with package-level architectural boundaries:
commonMainowns shared domain logic, validation, and use cases.jvmMain,iosMain, andjsMainprovide infrastructure adapters, such as HTTP engines, synchronization, and generic native value conversion. They must not become separate per-platform feature implementations.- Each host SDK owns platform-specific product behavior, UI integration, SDK lifecycle decisions, and its customer-facing API.
Group shared code by feature under tech.notifly.kmp. Keep reusable infrastructure in core, independent of feature packages. Use expect/actual for platform capabilities, not to split business rules across platforms.
Platform integration
The Android, iOS, and JavaScript repositories pin a KMP source commit as a Git submodule and build their own Core artifacts. Core and Full use the same platform SDK version, and Full depends on that exact Core version.
| SDK | Integration and distribution |
| --- | --- |
| Android | Gradle composite build; Core JAR and Full AAR distributed through JitPack. |
| iOS | Dynamic NotiflyCore.xcframework and Full SDK Swift sources, available through SwiftPM and CocoaPods. |
| JavaScript | notifly-core-sdk and notifly-js-sdk on npm; browser bundles include the required Core code. |
| React Native | Uses the Android and iOS SDKs through native bridges. |
| Flutter | Uses the Android and iOS SDKs; Flutter Web uses the JavaScript SDK. |
The iOS repository hosts the Core binary on its own GitHub Releases. Customers do not need to select a separate KMP source version.
Contributor conventions
- Write repository documentation, comments, identifiers, and test names in English, except for required non-English test fixtures.
- Keep implementation details internal and public interfaces small and usable from Kotlin, Swift, and JavaScript.
- Explain contracts above declarations with KDoc. Minimize inline comments and document rationale rather than narrating code.
- Test observable behavior. Keep shared tests in
commonTestand platform-specific infrastructure or interop tests in the corresponding platform test source set. - Use the pinned ktlint configuration. Review formatting changes and keep unrelated edits out of a change.
See AGENTS.md for detailed architecture, language, comment, and test conventions, and scripts/README.md for build and validation tooling.
Development
Requirements:
- JDK 17
- Node.js 22
- macOS with Xcode for Apple targets
- Chrome for browser tests
Check Kotlin source, tests, and Gradle scripts before committing:
./gradlew ktlintCheck --no-daemonApply automatic formatting when needed, then rerun the check:
./gradlew ktlintFormat --no-daemon
./gradlew ktlintCheck --no-daemonThe ktlint Gradle plugin and engine versions are pinned in build.gradle.kts.
Style settings live in .editorconfig. CI and new releases run the check without
modifying files. Resuming an existing release skips lint so older tags remain
rebuildable. Semantic conventions still require review.
Run the shared test suite:
./gradlew \
jvmTest \
jsNodeTest \
jsBrowserTest \
iosSimulatorArm64Test \
--no-daemonKotlin compatibility
The build uses Kotlin 2.2.21. Common and JVM code target Kotlin language/API 1.8 with stdlib 1.8.10 for Android compatibility. Kotlin/JS uses the stdlib matching the build compiler.
Repository structure
.
├── src/ # Shared Kotlin Multiplatform sources
├── scripts/ # Build and validation tools
├── smoke-tests/ # Consumer-level verification projects
└── .github/ # Automation workflows