This example project has the following parts:
- An Android app in android
- A shared code module in shared. This exposes and android library, and kotlin native sourceset that depends on a common source set. These are then included in the build of the iOS and Android example apps.
- An iOS app in ios
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=maven
.
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://oss.sonatype.org/content/repositories/snapshots/
In conjunction, you can set the kaluga.libraryVersion
property. This will override the version of kaluga to look for. For example:
kaluga.libraryVersion=0.2.2-SNAPSHOT
Please note that this also overrides the version when building kaluga itself.
In order to make kaluga-links example work correctly, you must sign the app with a signing certificate beloging 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.
The iOS app can be opened by either XCode or the KMM plugin of Android Studio.
The Android app can be opened with Android Studio, at times the latest Beta or Canary release is needed (see DEVELOP)
This project uses a structure created by Appcode (the Kotlin/Native plugin of Appcode is now unfortunately not recent anymore) , the root settings.gradle.kts
file is under Supporting Files, so this is the directory to open with Android studio.