Docs

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

  1. In Xcode, go to File → Add Package Dependencies…
  2. Enter the repository URL: https://github.com/grovs-io/grovs-iOS.git
  3. Choose Up to Next Major Version starting at 3.0.0
  4. Add the Grovs library to your app target

If you manage dependencies in a Package.swift:

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:

Ruby
pod 'Grovs', '~> 3.0'

Then run:

Bash
pod install

Configuration

Import the module and configure the SDK in application(_:didFinishLaunchingWithOptions:):

Swift
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

Swift
Grovs.configure(
    APIKey: String,
    useTestEnvironment: Bool,
    baseURL: String? = nil,
    autoTrackScreenViews: Bool = true,
    clipboardDomains: [String]? = nil,
    enabled: Bool = true,
    delegate: GrovsDelegate?,
    completion: GrovsBoolCompletion? = nil
)
ParameterDefaultDescription
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.
baseURLGrovs cloudDomain of a self-hosted backend, e.g. "https://sdk.example.com". The SDK appends the API path.
autoTrackScreenViewstrueTrack screen views automatically. See Events & Screen Tracking.
clipboardDomainsnoneExtra link hosts accepted by clipboard-assisted deferred deep linking. Grovs-owned hosts are always accepted.
enabledtrueWhether 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:

Swift
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:

Swift
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

See also

Edit this page on GitHubLast updated 2026-10-07