You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're targeting macOS, you must first enable the Outgoing Connections (Client) checkbox under the App Sandbox section.
First, you need to get your App Key from Aptabase, you can find it in the Instructions menu on the left side menu.
Initialized the SDK as early as possible in your app, for example:
import SwiftUI
import Aptabase
@mainstructExampleApp:App{init(){Aptabase.shared.initialize(appKey:"<YOUR_APP_KEY>") // 👈 this is where you enter your App Key
}varbody:someScene{WindowGroup{MainView()}}}
Afterward, you can start tracking events with trackEvent:
import Aptabase
Aptabase.shared.trackEvent("app_started") // An event with no properties
Aptabase.shared.trackEvent("screen_view", with:["name":"Settings"]) // An event with a custom property
A few important notes:
The SDK will automatically enhance the event with some useful information, like the OS, the app version, and other things.
You're in control of what gets sent to Aptabase. This SDK does not automatically track any events, you need to call trackEvent manually.
Because of this, it's generally recommended to at least track an event at startup
The trackEvent function is a non-blocking operation as it runs in the background.
Only strings and numbers values are allowed on custom properties