An Example project to demonstrate functionality and best practices for using Kaluga.
This example project has the following parts:
- An Android app in android
- A shared code module in shared. This exposes an Android library, and a Kotlin/Native sourceset that depends on a common source set. These are then included in the build of the Android and iOS example apps respectively.
- An iOS app in ios
To access the shared code, simply open this folder in Android Studio. From there you can build the Android module and shared code. At times the latest Beta or Canary release is needed (see DEVELOP)
The iOS example can be built using XCode using the Demo XCode Project.
The iOS projects uses Kaluga SwiftUI for bridging the project to SwiftUI. This requires installing by running sh install.sh from the ios folder.
The example app can load the main components either through your (local) maven repository, or as gradle modules.
The advantage of using a gradle module is that you can edit the source of components and run them in the example right away, without needing to publish them to maven first.
By default Kaluga dependency is included as a composite build. You also can put the property kaluga.exampleEmbeddingMethod=composite in the local.properties file in the root of the project (this file is already generated by your IDE normally) to specify it explicitly. To enable maven use kaluga.exampleEmbeddingMethod=repo.
You can also set the kaluga.exampleMavenRepo property to specify which maven repo to look in. By default this is mavenLocal() (this can also be used by explicitly setting the value local). For example to set this to the sonatype snapshot repository use:
kaluga.exampleMavenRepo=https://s01.oss.sonatype.org/content/repositories/snapshots/In order to make kaluga-links example work correctly, you must sign the app with a signing certificate belonging to our team or using the debug.keystore file we provide.
The goal of the example is to show the usages of links module, but on top of that we are also showing the flow where user are redirected to the app without being asked "Open with..." dialog.
To do so the backend must contain in https://whatever.domain/.well-known two file named respectively assetlinks.json and apple-app-site-association.
assetlinks.json should have the following format
[
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "app.package",
"sha256_cert_fingerprints": [
<sha256_fingerprint_1>,
...
<sha256_fingerprint_n>,
]
}
}
]
More info about Android App Links.
While apple-app-site-association will be
{
"applinks": {
"apps": [], // This array MUST be empty (for more info check Universal link's doc below). -->
"details": [
{
"appID": "appId",
"paths": ["path_1", "path_2"] // Use wildcard "*" if you accept every path.
}
]
}
}
appId = teamId.bundleId
More info about iOS Universal Links.
For Android you can choose whether the location permission is automatically requested on Android 12 or higher for using Bluetooth by changing the useBluetoothForLocation constant, in [example/shared/src/commonMain/kotlin/com/splendo/kaluga/example/shared/di/DependencyInjection.kt]. By default it is off.