Skip to content

2.0.0

Compare
Choose a tag to compare
@arnaud-roland arnaud-roland released this 26 Apr 16:45
· 5 commits to master since this release

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 to BatchSDK.
  • 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 the loggerDelegate property.
  • Removed method setAssociatedDomains, which has been replaced by the associatedDomains property.
  • Removed method isOptedOut, which has been replaced by the isOptedOut property.
  • Removed method isRunningInDevelopmentMode with no equivalent.
  • Removed method handleURL with no equivalent.
  • Removed method setUseAdvancedDeviceInformation, you should now use the added updateAutomaticDataCollectionAPI.
  • Renamed method debugViewController to makeDebugViewController.
  • 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 handleNotification.
  • Removed method handleNotification:actionIdentifier.
  • Removed method enableAutomaticDeeplinkHandling, which has been replaced by the enableAutomaticDeeplinkHandling property.
  • Removed method lastKnownPushToken, which has been replaced by the lastKnownPushToken property.
  • Added async variants of 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().
  • 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.
  • Added helpers to extract Batch notification information from UNNotification instances.
    • Added method isBatchNotification
    • Added method 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.

  • Removed deprecated class BatchUserProfile and all related methods/properties.
  • Removed deprecated method trackEvent:withLabel:data and all other variants. You should now use the BatchProfile.trackEvent APIs.
  • Removed method 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.
  • Removed method printDebugInformation with no equivalent.
  • Removed methods trackTransactionWithAmount and trackTransactionWithAmount:data with no equivalents.
  • Removed methods trackLocation, you should now use BatchProfile.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 to BatchEventAttributes
  • Removed deprecated method Batch.trackEvent(String event, String label, JSONObject data).
  • Removed all trackEvent APIs from the user module. You should now use Batch.Profile.trackEvent.
  • Removed addTag API from BatchEventData You should now use the $tags reserved key with putStringArray:forKey: method.
  • Removed parameter label from trackEvent APIs. You should now use the $label reserved key in BatchEventAttributes with the putStringt:forKey: method.
  • Added support for Array and Object attributes with the added APIs to BatchEventAttributes :
    • putObject:forKey
    • putObjectArray:forKey
    • putStringArray:forKey
  • Added validateWithError method to BatchEventAttributes to ensure your event attributes are valid before sending them.

Messaging

  • Removed method setDelegate, which has been replaced by the delegate property.
  • Removed method setCanReconfigureAVAudioSession, which has been replaced by the canReconfigureAVAudioSession property.
  • Removed method setAutomaticMode, which has been replaced by the automaticMode property.

Inbox

  • Removed deprecated property title from BatchInboxNotificationContent. You should access it from the message property.
  • Removed deprecated property body from BatchInboxNotificationContent. You should access it from the message property.
  • Removed deprecated property isDeleted from BatchInboxNotificationContent.

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 of BatchUser.editor().setIdentifier.
  • Added editor method to get a new instance of a BatchProfileEditor as replacement of BatchUserDataEditor.
  • 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 and trackEventWithName:attributes APIs as replacement of the BatchUser.trackEvent methods.
  • Added trackLocation API as replacement of the BatchUser.trackLocation method.

Fixes

  • Fixed an issues where the thread sanitizer would report an issue when opening deeplinks.