2.0.0
This is a major release, please see our migration guide for more info on how to update your current Batch implementation.
Batch requires Xcode 15.3 and iOS 13.0 or higher
Linking
- Dropped support for iOS 12 and lower.
- Batch is now distributed as a dynamic framework. You can now safely link Batch between multiple framework targets!
- Batch is now a mergeable dynamic library. The additional metadata induced by this feature makes the XCFramework distribution
heavier, but has no effect in the final size of Batch in your app once compiled.
visionOS
This version introduces visionOS support. Some features are still unsupported, like:
- In-App messaging and mobile landings are unavailable.
- In-App rating is not supported on visionOS due to an OS limitation.
Core
All deprecated APIs in the SDK v1 have been removed and some others have been renamed/reworked to feel Swift native.
- The
Batch
class has been renamed toBatchSDK
. - Batch has dropped the support for IDFA. You can no longer set an advertising id to Batch and all related APIs have been removed.
- Removed deprecated method
setUseIDFA
which was a no-op. - Removed method
setLoggerDelegate
, which has been replaced by theloggerDelegate
property. - Removed method
setAssociatedDomains
, which has been replaced by theassociatedDomains
property. - Removed method
isOptedOut
, which has been replaced by theisOptedOut
property. - Removed method
isRunningInDevelopmentMode
with no equivalent. - Removed method
handleURL
with no equivalent. - Removed method
setUseAdvancedDeviceInformation
, you should now use the addedupdateAutomaticDataCollection
API. - Renamed method
debugViewController
tomakeDebugViewController
. - Removed warning about unconfigured App Groups.
- Added
setDisabledMigrations(migrations:)
to explicitly disable profile's data migrations when running the SDK V2 for the first time when your app belongs to a project. - Added
updateAutomaticDataCollection(editor:)
to fine-tune the data sent by the SDK since Batch will not resolve the user's location/region and will not send the device type by default.
Push
- Removed deprecated method
setupPush
, which was a no-op. - Removed the ability to register notification categories using Batch. Please use the system API.
- Removed deprecated method
registerForRemoteNotifications
. - Removed deprecated method
registerForRemoteNotificationsWithCategories
. - Removed method
setNotificationsCategories
.
- Removed deprecated method
- Removed deprecated method
handleNotification
. - Removed method
handleNotification:actionIdentifier
. - Removed method
enableAutomaticDeeplinkHandling
, which has been replaced by theenableAutomaticDeeplinkHandling
property. - Removed method
lastKnownPushToken
, which has been replaced by thelastKnownPushToken
property. - Added async variants of
BatchPush.requestNotificationAuthorization()
andrequestProvisionalNotificationAuthorization()
. In non async Swift code and Objective-C, they are exposed as variants with a completion handler:BatchPush.requestNotificationAuthorization(completionHandler:)
/[BatchPush requestNotificationAuthorizationWithCompletionHandler:]
.
Note: In async Swift code, this is a breaking change as the language will force you to use the async variant. If you want to ignore the result, use:let _ = try? await BatchPush.requestNotificationAuthorization()
. - Removed pre-iOS 10
UINotification
related methods.
UNUserNotification and its related callbacks have been the only supported way to integrate Batch for a while as legacy
methods lead to unexpected behaviour.- Removed deprecated method
handleRegisterUserNotificationSettings
.
- Removed deprecated method
- Added helpers to extract Batch notification information from UNNotification instances.
- Added method
isBatchNotification
- Added method
deeplinkFromNotification
- Added method
BatchUNUserNotificationCenterDelegate
now defaults to showing foreground notifications.
User
Most of all user's related APIs have been removed and replaced with their equivalent in the new BatchProfile
module.
Only the reading methods are still present for backward-compatibility but keep in mind these methods are only about the installation data and not your Profile since it may be updated from another source.
- Removed deprecated class
BatchUserProfile
and all related methods/properties. - Removed deprecated method
trackEvent:withLabel:data
and all other variants. You should now use theBatchProfile.trackEvent
APIs. - Removed method
BatchUser.editor
and the related classBatchUserDataEditor
, you should now useBatchProfile.editor
which return an instance ofBatchProfileEditor
orBatchProfile.editWithBlock
to directly edit attributes in a closure. - Removed method
printDebugInformation
with no equivalent. - Removed methods
trackTransactionWithAmount
andtrackTransactionWithAmount:data
with no equivalents. - Removed methods
trackLocation
, you should now useBatchProfile.trackLocation
. - Added
BatchUser.clearInstallationData()
which allows you to remove the installation data without modifying the current profile.
Event
This version introduced two new types of attribute that can be attached to an event : Array and Object.
- Renamed
BatchEventData
class toBatchEventAttributes
- Removed deprecated method
Batch.trackEvent(String event, String label, JSONObject data)
. - Removed all
trackEvent
APIs from the user module. You should now useBatch.Profile.trackEvent
. - Removed
addTag
API fromBatchEventData
You should now use the$tags
reserved key withputStringArray:forKey:
method. - Removed parameter
label
fromtrackEvent
APIs. You should now use the$label
reserved key inBatchEventAttributes
with theputStringt:forKey:
method. - Added support for Array and Object attributes with the added APIs to
BatchEventAttributes
:putObject:forKey
putObjectArray:forKey
putStringArray:forKey
- Added
validateWithError
method toBatchEventAttributes
to ensure your event attributes are valid before sending them.
Messaging
- Removed method
setDelegate
, which has been replaced by thedelegate
property. - Removed method
setCanReconfigureAVAudioSession
, which has been replaced by thecanReconfigureAVAudioSession
property. - Removed method
setAutomaticMode
, which has been replaced by theautomaticMode
property.
Inbox
- Removed deprecated property
title
fromBatchInboxNotificationContent
. You should access it from themessage
property. - Removed deprecated property
body
fromBatchInboxNotificationContent
. You should access it from themessage
property. - Removed deprecated property
isDeleted
fromBatchInboxNotificationContent
.
Profile
Introduced BatchProfile
, a new module that enables interacting with profiles. Its functionality replaces most of BatchUser
used to do.
- Added
identify
API as replacement ofBatchUser.editor().setIdentifier
. - Added
editor
method to get a new instance of aBatchProfileEditor
as replacement ofBatchUserDataEditor
. - Added
editWithBlock
to directly edit profile attributes in a closure. Note: there's no need to save the editor in the closure since it done automatically. - Added
trackEventWithName
andtrackEventWithName:attributes
APIs as replacement of theBatchUser.trackEvent
methods. - Added
trackLocation
API as replacement of theBatchUser.trackLocation
method.
Fixes
- Fixed an issues where the thread sanitizer would report an issue when opening deeplinks.