Quick Start
Install and configure the Grovs iOS SDK in your app
Upgrading from 2.x? See the 3.0 upgrade guide.
Requirements
- iOS 13.0 or later
- Swift 5.9 (Xcode 15 or later)
- An app target — app extensions are not supported
- Your app's bundle ID and Apple App Prefix registered in the Grovs dashboard — see How to Get the Apple App Prefix
Installation
Swift Package Manager
- In Xcode, go to File → Add Package Dependencies…
- Enter the repository URL:
https://github.com/grovs-io/grovs-iOS.git - Choose Up to Next Major Version starting at
3.0.0 - Add the Grovs library to your app target
If you manage dependencies in a Package.swift:
dependencies: [
.package(url: "https://github.com/grovs-io/grovs-iOS.git", from: "3.0.0")
],
targets: [
.target(
name: "YourApp",
dependencies: [.product(name: "Grovs", package: "grovs-iOS")]
)
]CocoaPods
Add the pod to your Podfile:
pod 'Grovs', '~> 3.0'Then run:
pod installConfiguration
Import the module and configure the SDK in application(_:didFinishLaunchingWithOptions:):
import Grovs
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Optional: verbose logging while integrating
Grovs.setDebug(level: .info)
Grovs.configure(APIKey: "your-api-key", useTestEnvironment: false, delegate: self) { success in
if success {
print("Grovs SDK is ready")
}
}
// Optional: identify the user (after configure)
Grovs.userIdentifier = "user_id_from_your_app"
Grovs.userAttributes = ["name": "John Doe", "plan": "premium"]
return true
}Set userIdentifier, userAttributes, and pushToken only after calling configure. Values set before the SDK is configured are ignored, and the SDK logs an error.
Configuration options
Grovs.configure(
APIKey: String,
useTestEnvironment: Bool,
baseURL: String? = nil,
autoTrackScreenViews: Bool = true,
clipboardDomains: [String]? = nil,
enabled: Bool = true,
delegate: GrovsDelegate?,
completion: GrovsBoolCompletion? = nil
)| Parameter | Default | Description |
|---|---|---|
APIKey | — | Your project API key from the Grovs dashboard. |
useTestEnvironment | — | true targets your project's test environment (its own domain, links, and data); false targets production. Use true only in development builds. |
baseURL | Grovs cloud | Domain of a self-hosted backend, e.g. "https://sdk.example.com". The SDK appends the API path. |
autoTrackScreenViews | true | Track screen views automatically. See Events & Screen Tracking. |
clipboardDomains | none | Extra link hosts accepted by clipboard-assisted deferred deep linking. Grovs-owned hosts are always accepted. |
enabled | true | Whether the SDK may collect and send anything on this launch. Pass your stored consent value — it is not persisted. See Privacy & Consent. |
delegate | — | Receives deep link payloads and SDK errors. Held weakly — see Deep Linking. |
completion | — | Called on the main thread with whether authentication succeeded. Reports false without authenticating when enabled is false. |
Configure once per launch, from the main thread. Calling configure again replaces the previous configuration.
Delegate setup
Apps using SceneDelegate
If your app uses a SceneDelegate, forward these calls to the SDK:
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
Grovs.handleSceneDelegate(openURLContexts: URLContexts)
}
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
Grovs.handleSceneDelegate(continue: userActivity)
}
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
Grovs.handleSceneDelegate(options: connectionOptions)
}Apps using AppDelegate only
If your app does not use a SceneDelegate, forward these calls instead:
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
return Grovs.handleAppDelegate(continue: userActivity, restorationHandler: restorationHandler)
}
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
return Grovs.handleAppDelegate(open: url, options: options)
}Call the handleAppDelegate methods on the main thread, which is where UIKit delivers these callbacks. The handleSceneDelegate methods can be called from any thread.
Next steps
- Handle incoming deep links →
- Generate smart links →
- Gate collection on user consent →
- Explore the iOS example app →
See also
- How to Get the Apple App Prefix — find the Team ID required when configuring your app in the Grovs dashboard
- How to Get the Bundle Identifier — locate your app's Bundle Identifier in Xcode
- How to Add an Associated Domain — configure associated domains in Xcode for Universal Links
- How to Add a New URL Scheme — set up custom URL schemes for deep linking
- iOS setup checklist — verify the whole integration and test every deep link flow
- Deep link not opening the app — fix links that open the browser instead of your app
- SDK configuration issues — resolve common setup and initialization problems