Batch SDK for iOS
Compiles with Xcode 15.3 Batch requires Xcode 15.3 and iOS 13.0 or higher
Core
Compiles with Xcode 15.3 Batch requires Xcode 15.3 and iOS 13.0 or higher
Event
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
visionOS
This version introduces visionOS support. Some features are still unsupported, like:
Core
All deprecated APIs in the SDK v1 have been removed and some others have been renamed/reworked to feel Swift native.
Batch
class has been renamed to BatchSDK
.setUseIDFA
which was a no-op.setLoggerDelegate
, which has been replaced by the loggerDelegate
property.setAssociatedDomains
, which has been replaced by the associatedDomains
property.isOptedOut
, which has been replaced by the isOptedOut
property.isRunningInDevelopmentMode
with no equivalent.handleURL
with no equivalent.setUseAdvancedDeviceInformation
, you should now use the added updateAutomaticDataCollection
API.debugViewController
to makeDebugViewController
.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.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
setupPush
, which was a no-op.registerForRemoteNotifications
.registerForRemoteNotificationsWithCategories
.setNotificationsCategories
.handleNotification
.handleNotification:actionIdentifier
.enableAutomaticDeeplinkHandling
, which has been replaced by the enableAutomaticDeeplinkHandling
property.lastKnownPushToken
, which has been replaced by the lastKnownPushToken
property.BatchPush.requestNotificationAuthorization()
and requestProvisionalNotificationAuthorization()
. 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()
.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.
handleRegisterUserNotificationSettings
.isBatchNotification
deeplinkFromNotification
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.
BatchUserProfile
and all related methods/properties.trackEvent:withLabel:data
and all other variants. You should now use the BatchProfile.trackEvent
APIs.BatchUser.editor
and the related class BatchUserDataEditor
, you should now use BatchProfile.editor
which return an instance of BatchProfileEditor
or BatchProfile.editWithBlock
to directly edit attributes in a closure.printDebugInformation
with no equivalent.trackTransactionWithAmount
and trackTransactionWithAmount:data
with no equivalents.trackLocation
, you should now use BatchProfile.trackLocation
.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.
BatchEventData
class to BatchEventAttributes
Batch.trackEvent(String event, String label, JSONObject data)
.trackEvent
APIs from the user module. You should now use Batch.Profile.trackEvent
.addTag
API from BatchEventData
You should now use the $tags
reserved key with putStringArray:forKey:
method.label
from trackEvent
APIs. You should now use the $label
reserved key in BatchEventAttributes
with the putStringt:forKey:
method.BatchEventAttributes
:
putObject:forKey
putObjectArray:forKey
putStringArray:forKey
validateWithError
method to BatchEventAttributes
to ensure your event attributes are valid before sending them.Messaging
setDelegate
, which has been replaced by the delegate
property.setCanReconfigureAVAudioSession
, which has been replaced by the canReconfigureAVAudioSession
property.setAutomaticMode
, which has been replaced by the automaticMode
property.Inbox
title
from BatchInboxNotificationContent
. You should access it from the message
property.body
from BatchInboxNotificationContent
. You should access it from the message
property.isDeleted
from BatchInboxNotificationContent
.Profile
Introduced BatchProfile
, a new module that enables interacting with profiles. Its functionality replaces most of BatchUser
used to do.
identify
API as replacement of BatchUser.editor().setIdentifier
.editor
method to get a new instance of a BatchProfileEditor
as replacement of BatchUserDataEditor
.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.trackEventWithName
and trackEventWithName:attributes
APIs as replacement of the BatchUser.trackEvent
methods.trackLocation
API as replacement of the BatchUser.trackLocation
method.Fixes
Compiles with Xcode 15.1 Batch requires Xcode 15.1 and iOS 12.0 or higher
Core
Compiles with Xcode 15.1 Batch requires Xcode 15.1 and iOS 12.0 or higher
Core
MinimumOSVersion
of 100.0
to workaround a framework validation bug on Xcode 15.3.Compiles with Xcode 15.1 Batch requires Xcode 15.1 and iOS 12.0 or higher
Core
Batch.setCanUseIDFA
is now a no-op.[BatchUserDataEditor setAttributionIdentifier:]
method.In-App
Compiles with Xcode 14.3.1 Batch requires Xcode 14.3.1 and iOS 11.0 or higher
Note: Due to Xcode 15 dropping support for iOS 11.0, this is the last minor version supporting iOS 11.
Core
onOpenUrl
(iOS 14+). For iOS 13, implement your own UISceneDelegate
using a custom application delegate or use a BatchDeeplinkDelegate
.User
[BatchUserDataEditor setEmail:]
. This requires to have a user identifer registered or to call the setIdentifier
method on the editor instance beforehand.[BatchUserDataEditor setEmailMarketingSubscriptionState:]
method to subscribe to the email marketing list.Inbox
BatchPushMessage
has been displayed from the inbox via the isDisplayedFromInbox
property.BatchInboxNotificationContent
using the hasLandingMessage()
method.BatchInboxNotificationContent
using the displayLandingMessage()
method.Messaging
[BatchMessaging setEnableDynamicType:false]
.SFSafariViewController
as it should not be hidden or obscured by other views or layers.Compiles with Xcode 13.3.1 Batch requires Xcode 13.3.1 and iOS 10.0 or higher
Note: Due to Xcode 14 dropping support for Bitcode and 32-bit architectures, this is the last minor version to be bundled with these slices.
Messaging
<video>
elements.Compiles with Xcode 13.3.1 Batch requires Xcode 13.3.1 and iOS 10.0 or higher
Note: Due to Xcode 14 dropping support for Bitcode and 32-bit architectures, this is the last minor version to be bundled with these slices.
Core
Messaging
Compiles with Xcode 13.3.1 Batch requires Xcode 13.3.1 and iOS 10.0 or higher
Note: Due to Xcode 14 dropping support for Bitcode and 32-bit architectures, this is the last minor version to be bundled with these slices.
Core
[BatchUserDataEditor save]
could make concurrent accesses to SQLite and crash.Messaging