iOS integration
Basic Setup
1
2
Initialize SDK
import UIKit
import AmplySDK
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
private static var amplySDK: Amply?
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let config = AmplyConfig(
appId: "your.app.id",
apiKeyPublic: "your_public_key",
apiKeySecret: "your_secret_key",
defaultConfig: nil
)
AppDelegate.amplySDK = Amply(config: config)
return true
}
static func getAmply() -> Amply? {
return amplySDK
}
}Configuration Options
Full Configuration
let config = AmplyConfig(
appId: "your.app.id",
apiKeyPublic: "your_public_key",
apiKeySecret: "your_secret_key",
defaultConfig: nil, // Optional: default campaign JSON
configBaseUrl: "https://config.amply.tools", // Optional: override
backendBaseUrl: "https://api.amply.tools" // Optional: override
)Tracking Events
Basic Events
From View Controllers
From SwiftUI Views
Handling Deep Links
Register Listener
System Events
Rate & Review
Get Dataset Snapshots
Get Recent Events
App Lifecycle
Best Practices
Troubleshooting
Last updated