Before you begin
- An Aplyna account and Admin access to your organization.
- An iOS app using Swift 6 / iOS 16+, or an Android app using API 23+ and JDK 17.
- A place to persist an anonymous installation ID and a consent decision.
- Network access to https://aplyna.com over HTTPS.
1. Create your application
- Sign in and choose the workspace where your app belongs.
- Open the application selector and choose Add app. Enter the name, platform, category and app identifier.
- Save. Aplyna opens Apps with the new app selected.
- Copy the one-time SDK key before dismissing it. Keep it with this application's configuration; never use Apple .p8 credentials in the SDK.
2. Install your platform SDK
3. Configure and send an event
Create one client for your app integration. Persist the installation ID before initialization and reuse it on every launch. Execute Swift calls from an async context; execute Kotlin network methods on a background thread.
import Foundation
import Aplyna
// Create once and persist; reuse this ID across app launches.
let defaults = UserDefaults.standard
let installationID = defaults.string(forKey: "aplyna.installationID")
?? UUID().uuidString
defaults.set(installationID, forKey: "aplyna.installationID")
let client = AplynaClient(
baseURL: URL(string: "https://aplyna.com")!,
apiKey: "YOUR_APP_SDK_KEY",
installationID: installationID
)
// Run in an async context, after your consent flow permits tracking.
try await client.setConsent(true)
try await client.track(name: "app_opened")
try await client.flush()import com.aplyna.sdk.AplynaClient
import java.util.UUID
val prefs = context.getSharedPreferences("aplyna", 0)
val installationId = prefs.getString("installation_id", null)
?: UUID.randomUUID().toString().also {
prefs.edit().putString("installation_id", it).apply()
}
val client = AplynaClient(
baseUrl = "https://aplyna.com",
apiKey = "YOUR_APP_SDK_KEY",
installationId = installationId,
storageDirectory = context.filesDir
)
// After consent; call networking methods off the main thread.
client.setConsent(true)
client.track(name = "app_opened")
client.flush()4. Verify delivery
- Confirm flush completes without an error. Track first: an empty queue sends no request.
- Open Aplyna and select the exact application that issued your SDK key.
- Open Charts and inspect SDK activity for the time period containing your event.
- Check the installation count and timestamps. A single installation can send many events.
- If delivery fails, inspect the HTTP error before repeating the request.