iOS SDK 3.1
What changes when you move the Grovs iOS SDK from 3.0 to 3.1.
3.1.0 adds push campaigns and in-app messages, and removes the messages inbox. Most apps bump the version and fix what the compiler flags.
Requirements are unchanged: iOS 13.0, Swift 5.9 (Xcode 15).
Checklist
- Bump the dependency to 3.1.0.
- Handle the new
GrovsErrorcase if youswitchover it. - Check your
GrovsDelegatemethods for "nearly matches" warnings. - Remove the messages inbox from your UI.
- Rename custom events that use a reserved name.
- Check the other behavior changes.
- Optional: set up push campaigns and react to in-app messages.
1. Bump the version
Swift Package Manager: set the Grovs package rule to Up to Next Major Version from 3.1.0. In a Package.swift:
.package(url: "https://github.com/grovs-io/grovs-iOS.git", from: "3.1.0")CocoaPods: in your Podfile:
pod 'Grovs', '~> 3.1'For campaign images in push notifications, add the new GrovsNotificationService product or pod to a Notification Service Extension target. See Campaign images.
2. Handle GrovsError.inAppDisplayFailed
New case inAppDisplayFailed (5): an in-app message couldn't be drawn. An exhaustive switch won't compile until you handle it:
func grovsDidEncounterError(_ error: GrovsError, message: String) {
switch error {
case .authenticationFailed, .networkRequestFailed, .eventDispatchFailed, .linkGenerationFailed:
Log.warning("grovs: \(message)")
case .inAppDisplayFailed:
Log.info("grovs in-app: \(message)")
}
}3. Check your GrovsDelegate methods
GrovsDelegate and the new GrovsInAppDelegate are now @objc protocols with @objc optional methods, so Objective-C apps can adopt them. GrovsError is an @objc enum and Grovs an NSObject.
Most apps stay source-compatible, but the Swift default implementation of grovsDidEncounterError is gone. A delegate method that doesn't match the signature exactly compiles with only a "nearly matches" warning and is never called. Build once and check those warnings.
4. Remove the messages inbox
The inbox is gone on the device and the backend. In-app messages replace it.
Grovs.displayMessagesViewController(completion:)anddisplayMessagesViewController(completion:onFailure:)are deprecated and show nothing. They callcompletiononce on the main thread and never callonFailure.Grovs.numberOfUnreadMessages(completion:)is deprecated and always yields0.- The SDK no longer displays dashboard messages automatically, calls the inbox endpoints, or ships the inbox XIBs.
- A push carrying only
grovs_notification_idis no longer a Grovs push:isGrovsNotification(userInfo:)and the notification handlers returnfalsefor it. Remove any code that opened the inbox from such a push.
Remove inbox buttons and unread badges. Campaigns built under Engage in the dashboard show on their own once the SDK is configured.
5. Rename reserved event names
track(_:) now refuses the same names as the backend. Rename any custom event that uses one:
in_app_viewed, in_app_clicked, in_app_dismissed, in_app_answered, in_app_commented, in_app_held, push_open, push_delivered, push_held, journey_entered, journey_held, journey_path.
6. Other behavior changes
- Push opens. Call
handleNotificationOpen(userInfo:)only for a tap on a notification, never fromdidReceiveRemoteNotificationorwillPresent, or each delivery counts as an open. A tap on a push that carries a Grovs link counts once, aspush_open: the link isn't also counted as a link open, and later events aren't attributed to it. - Screen tracking. A view controller class named exactly
ViewController(orController) is now tracked under that name. Before, its cleaned name was empty and it was never tracked. - Push token. A push token set before authentication no longer clears the user's identifier and attributes on the server.
- Other apps' URL schemes.
handleAppDelegate(open:options:)returnsfalsefor a custom scheme other than your project's Grovs URL scheme, such as a sign-in callback, so a handler after Grovs in an||chain still gets it. - Purchases.
logInAppPurchaseandlogCustomPurchasesave the purchase before sending it, including before authentication. Once configured and enabled, afalsecompletion means it's kept and retried, so don't log it again. - Events before authentication.
trackandtrackScreenViewcalls made before authentication completes are stored on disk, not held in memory. - Locked after reboot. On a background launch before the first unlock,
configurewaits until the device is unlocked or the app becomes active. - Privacy manifest. It now declares the file timestamp reason (C617.1) for the SDK's disk cache. Review your App Store privacy details if you copy them from the manifest.
- CocoaPods.
Grovs.podspeccompiles only the main SDK; the extension code ships in its own pod,GrovsNotificationService.
Verify the upgrade
- Build with no "nearly matches" warnings on your delegate methods.
- Open a Grovs link and check that
grovsReceivedPayloadFromDeeplinkstill receives it. - In the dashboard, create an in-app campaign triggered on app open, use Send test with your own user identifier, and bring the app to the foreground. The message shows at the next sync.
- If you use push, send a campaign to your own user identifier and tap it. The open shows in the campaign report.
Full list of changes: iOS CHANGELOG.