Upgrading to 3.0
What changes when you move the Grovs iOS SDK from 2.x to 3.0
3.0 is a major release because it removes four public types and changes one closure signature. Most apps upgrade by bumping the version and making one decision about screen tracking.
Minimum deployment target is unchanged: iOS 13.0, Swift 5.9.
1. Bump the version
Swift Package Manager — in Xcode, select the Grovs package under Package Dependencies and raise the version rule to 3.0.0.
CocoaPods — in your Podfile:
pod 'Grovs', '~> 3.0'Then run pod update Grovs.
2. Decide on automatic screen tracking
This is the one change that alters behavior without any code edit on your side.
autoTrackScreenViews defaults to true. An app that only recompiles begins hooking UIViewController.viewDidAppear and sending screen_view events for every screen.
Keep it if you want screen analytics — see Events & Screen Tracking for how names are resolved and how to override them.
Opt out by passing false:
Grovs.configure(
APIKey: "your-api-key",
useTestEnvironment: false,
autoTrackScreenViews: false,
delegate: self
)Existing configure calls compile unchanged — the new parameters have defaults.
3. Remove references to types that are now internal
Four types were public in 2.x and are internal in 3.0. They were SDK implementation details and were never meant to be called from an app, but if you referenced one directly, the build will fail:
| Type | Was | Replacement |
|---|---|---|
DataCache | open class, plus DataCache.instance | None. Use your own cache. |
BaseService | open class | None. Use URLSession directly. |
ImageFormat | public enum | None. |
JSONClosure | public typealias | Define your own closure type. |
4. Update GrovsDeviceDataClosureClosure if you use it
The typealias gained a leading success flag so transport failures can be told apart from an empty result:
// 2.x
(_ dictionary: [String: Any]?, _ link: String?, _ tracking: [String: Any]?) -> Void
// 3.0
(_ success: Bool, _ dictionary: [String: Any]?, _ link: String?, _ tracking: [String: Any]?) -> VoidMost apps never name this type — it appears in the SDK's own service layer. If you declared a variable or function parameter with it, add the leading parameter.
Other behavior changes
setSDK(enabled: false) now stops everything. In 2.x it blocked link generation and deep link resolution but left lifecycle event collection running. In 3.0 it also stops lifecycle events, custom events, and automatic screen tracking. Events already queued stay on disk and are sent if you re-enable the SDK. If you use the flag as a consent gate, this is the behavior you wanted.
Queued events survive the upgrade. 3.0 reads event archives written by 2.x, so nothing pending on a user's device is lost.
What's new in 3.0
Nothing here is required, but it is what the release is for:
- Custom events and screen tracking —
track,trackScreenView, global tags, screen aliases,.grovsScreen()for SwiftUI, andGrovsScreenTrackingfor UIKit. - Error callbacks —
GrovsDelegategained an optionalgrovsDidEncounterError(_:message:). It has a default implementation, so existing delegates need no change. - Clipboard-assisted deferred deep linking — deterministic install attribution on first launch, with
clipboardDomainsfor custom link domains. copyToClipboardiOS/copyToClipboardAndroid— per-link override of the project's copy-to-clipboard setting.
Verifying the upgrade
Turn on info logging and confirm the SDK authenticates and reports the new version:
Grovs.setDebug(level: .info)Then check that deep links still route through grovsReceivedPayloadFromDeeplink, and — if you kept automatic screen tracking — that screen views appear in the dashboard under names you recognize. Use setScreenAliases to rename any that read like class names.
See also
- Quick Start — full configuration reference
- API Reference — every property, method, and type
- SDK Releases — where release notes are published