Batch 3.0

Batch SDK v3 is a major release, which introduces breaking changes from 2.x. This guide describes how to update your application when using a previous version.

Upgrading the SDK version


⚠️ Batch SDK 3.0 now requires Xcode 16.3 and iOS 15.0 or higher.

To upgrade from v2 to v3, you need to change the SDK version according to your package manager:

Update by using the "update package" option from Xcode or updating your package.swift.

Package.swift
.package(url: "https://github.com/BatchLabs/Batch-iOS-SDK", from: "3.0.1")

Messaging migration


Batch SDK v3 adds compatibility for Mobile Landings with Push v2 which can be created from the Batch Dashboard's drag & drop composer.

In-App Message Interception

The method batchInAppMessageReady has been removed from the BatchMessagingDelegate protocol. Please replace its usage with the new BatchInAppDelegate protocol.

Use the property access BatchMessaging.inAppDelegate to set your custom delegate.

So if you were doing:

You should now do:

For more information, please see the In-App messaging manual mode section.

Messaging Delegate

The following methods in BatchMessagingDelegate have been removed:

  • batchMessageWasCancelledByAutoclose

  • batchMessageWasCancelledByUserAction

  • batchMessageWasCancelledByError

  • batchWebViewMessageDidTriggerAction

Please update your implementation to use the batchMessageDidDisappear:(NSString *_Nullable)messageIdentifier reason:(BatchMessagingCloseReason)reason; method. The new BatchMessagingCloseReason enum will provide the context about why the message was closed.

WebView actions will now trigger the updated batchMessageDidTriggerAction method, with the analyticsID of the action being passed as the ctaIdentifier.

The index (NSInteger) parameter in batchMessageDidTriggerAction has been replaced by ctaIdentifier (NSString). The method signature is now

The constant BatchMessageGlobalActionIndex now returns a NSString instead of an NSInteger. Update any comparisons or usage accordingly.

So if you were doing:

You should now do:

For more information, please see the listening lifecycle event section.


To see in details what's precisely changed since V2 please consult our changelog or visit the APIs Reference.

Last updated