Releases: BatchLabs/Batch-Android-SDK
3.0.0
This is a major release, please see our migration guide for more info on how update your current Batch implementation.
Core
- Batch now compiles with SDK 36 (Android 16 'Baklava').
- Batch now uses Kotlin (1.9.0) internally. This should not affect your existing Java-based integrations as public APIs remain in Java.
Push
- Fixed an issue where push notifications could display a blank area when the image download failed.
- Added
Batch.Push.setShowNotifications
method to control whether push notifications should be displayed. - Added
Batch.Push.shouldShowNotifications
method to check current notification display settings. - Removed
PushNotificationType
enum and related methodsgetNotificationsType
andsetNotificationsType
fromBatch.Push
. You should now usesetShowNotifications
to control whether Batch should display notifications or not. Note that Batch still preserves your previous values andshouldShowNotifications
will reflect them."
Profile
- Fixed an issue preventing Turkish-speaking users from correctly setting Email/SMS subscription states.
Messaging
- Added compatibility for Mobile Landings with Push v2 which can be created from the drag & drop composer in the Batch Dashboard.
- Added interface
Batch.Messaging.InAppInterceptor
and methodBatch.Messaging.setInAppInterceptor
in order to handle messages yourself. - Added method
loadMessagingView
to control when and how a mobile landing will be displayed. LifecycleListener
has been redesigned:- Added method
onBatchMessageClosed(String, MessagingCloseReason)
. - Added enum
Batch.Messaging.LifecycleListener.MessagingCloseReason
which indicates why an In-App message was closed. - Updated method
onBatchMessageActionTriggered
. Theindex
parameter has been replaced byctaIdentifier
. This method is still called on MEP (Mobile Engagement Platform) messages, but you will now receive an identifier built from the old cta index : “mepCtaIndex:” + index. - Removed individual close callback methods (
onBatchMessageCancelledByUser
,onBatchMessageCancelledByAutoclose
,onBatchMessageCancelledByError
,onBatchMessageClosed
). Use the new unifiedonBatchMessageClosed(String, MessagingCloseReason)
method. - Removed method
onBatchMessageWebViewActionTriggered
. This will now triggered ononBatchMessageActionTriggered
with theanalyticsID
asctaIdentifier
. - Constant
GLOBAL_TAP_ACTION_INDEX
now returns a String instead of an int.
- Added method
- Removed
Batch.Messaging.LifecycleListener2
interface, you should now useBatch.Messaging.InAppInterceptor
withsetInAppInterceptor
. - Removed enum
Format
and methodgetFormat
fromBatchMessage
. You should now check the kind of aBatchMessagingView
to use the dedicated right methods to show your message. - Removed methods
loadFragment
andloadBanner
fromBatch.Messaging
. Use the newloadMessagingView
method instead. - Removed class
BatchBannerView
. UseBatchMessagingView
returned byloadMessagingView
instead. - Renamed method
getContent
from classBatchInAppMessage
togetMEPContent
. This method will return null for messages coming from the CEP (Customer Engagement Platform).
Debug
- Added support for edge-to-edge display in
BatchDebugActivity
.
2.1.1
Inbox
- Fixed an issue where a
BatchInboxNotificationContent
could not be flagged as silent.
Messaging
- Fixed an issue where
isDismissAction
ofBatchMessageAction
always return false
2.1.0
Core
- Batch now compiles with SDK 35 (Android 15 'Vanilla Ice Cream').
- Opted-out the Batch Debug Activity from Android 15 edge-to-edge enforcement.
Profile
- Added
setPhoneNumber
API to theBatchProfileAttributeEditor
class. This requires to have a user identifier registered or to call theidentify
method beforehand. - Added
setSMSMarketingSubscription
API to theBatchProfileAttributeEditor
class. - Strengthened custom user identifier validation on
identify
API to avoid unintended values.
2.0.3
Core
- Fixed an issue where Batch wasn't clearing some data when using
Batch.optOutAndWipeData()
. Since version 2.0, the Batch SDK caches some data (such as device language/region) to detect changes. It's this data that was not deleted when calling the opt-out method with data deletion. This issue only affects local SDK data and not server-side data.
2.0.2
Profile
- Fixed an issue where Batch would crash when using
addToArray
orremoveFromArray
on aBatchProfileAttributeEditor
instance.
2.0.1
Core
- Fix an issue where some methods were obfuscated in a class annotated with
@keep
since AGP 8.0 enables R8 full mode by default.
1.21.2
Messaging
- Fixed a rare crash on In-App Webview format that could happen when Batch would get the deeplink url for an image embedded into a hyperlink.
- Fixed a rare crash on In-App and Mobile Landing that could happen when Batch would display a wrong gif format.
2.0.0
This is a major release, please see our migration guide for more info on how to update your current Batch implementation.
Core
All deprecated APIs in the SDK v1 have been removed and some others have been renamed/reworked.
- The
Config
class has been removed with all related methods likeBatch.setConfig(Config config)
API. You should now useBatch.start(String apiKey)
. - Removed
setCanUseAndroidID
method fromConfig
with no equivalent. - Removed
setCanUseInstanceID
method fromConfig
with no equivalent. - Removed
setShouldAutomaticallyRegisterPush
method fromConfig
with no equivalent. - Removed
setUseAdvancedDeviceInformation
method fromConfig
. You should now use the newBatch.updateAutomaticDataCollection
API. Please see our documentation for more information. - Removed
Batch.getApiKey
with no equivalent. - Removed
Batch.shouldUseGoogleInstanceID
with no equivalent. - Removed
Batch.shouldAutoRegisterForPush
with no equivalent. - Removed
Batch.isRunningInDevMode
with no equivalent. - Removed
Batch.shouldUseAdvancedDeviceInformation
with no equivalent.
Core - Advertising ID
Batch has dropped the support for Android Advertising ID. You can no longer set an advertising id to Batch and all related APIs have been removed.
- Removed
setCanUseAdvertisingID
method fromConfig
which was a no-op. - Removed
Batch.shouldUseAdvertisingID
which was a no-op. - Removed
Batch.getAdvertisingID
which was a no-op. - Removed class
AdsIdentifierProvider
. - Removed class
AdsIdentifierProviderAvailabilityException
. - Removed class
AdsIdentifierProviderAvailabilityException
.
Core - New APIs
- Added
Batch.updateAutomaticDataCollection
to fine-tune the data sent by the SDK since Batch will not resolve the user's location/region and will not send device type and brand by default. - Added
Batch.disableMigration(EnumSet<BatchMigration>)
to explicitly disable some profile's data migration when running the SDK V2 for the first time if your app is linked to a project.
User
Most of all user's related APIs have been removed and replaced with their equivalent in the new Profile
module. Only the reading methods are still present for backward-compatibility but keep in mind this methods are only about the installation data and not your Profile since it may be updated from another source.
- Removed deprecated API
Batch.User.getEditor
. - Removed deprecated class
BatchUserProfile
. - Removed method
printDebugInformation
with no equivalent. - Removed method
trackTransaction
with no equivalent. - Removed method
Batch.User.editor
and the related classBatchUserDataEditor
, you should now useBatch.Profile.editor
which return an instance ofBatchProfileAttributeEditor
. - Added
Batch.User.clearInstallationData()
which allows you to remove the installation data without modifying the current profile.
Push
Batch has dropped support for old push providers (GCM, IID) and now only support for FCM's Token APIs. Overriding the Sender ID is no longer possible in any way due to Firebase limitations.
- Removed deprecated method
Batch.setGCMSenderId
. - Removed deprecated class
BatchPushData
. - Removed deprecated method
getPriority
fromBatchPushPayload
. - Removed
Batch.Push.getLastKnownPushToken
. You can now get the whole registration withBatch.Push.getRegistration
and usegetToken
to access to the push token registration. - Batch now defaults to showing foreground notifications rather than directly displaying mobile landings.
- Added
Batch.Push.requestNotificationPermission(context, listener)
API to request the notification permission with a callback notifying whether the permission has been granted or not. - Batch does not honor the
batch_push_fcm_sender_id_override
AndroidManifest meta-data anymore.
Event
This version introduced two new types of attribute that can be attached to an event : Array and Object.
- 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
. BatchEventData
has been renamed intoBatchEventAttributes
.- Removed
addTag
API fromBatchEventData
You should now use the$tags
key withputStringList
method. - Removed parameter
label
fromtrackEvent
API. You should now use the$label
key inBatchEventAttributes
with theput(string, string)
method. - Added support for Array and Object attributes with the added APIs to
BatchEventAttributes
:put(String key, BatchEventAttributes value)
putObjectList(String key, List<BatchEventAttributes> value)
putStringList(String key, List<String> value)
- Added
validateEventAttributes
method toBatchEventAttributes
which return a list of human-readable errors to ensure your event attributes are valid before sending them.
Inbox
- Removed deprecated
Batch.Inbox.getFetcher
method. - Removed deprecated
isDeleted
method fromBatchInboxNotificationContent
.
Profile
Introduced Profile
, a new module that enables interacting with profiles. Its functionality replaces most of the User
module used to do.
- Added
identify
API as replacement ofBatch.User.editor().setIdentifier
. - Added
editor
method to get a new instance of anBatchProfileAttributeEditor
as replacement ofBatchUserDataEditor
. - Added
trackEvent
APIs as replacement of theBatch.User.trackEvent
methods. - Added
trackLocation
API as replacement of theBatchUser.trackLocation
method.
1.21.1
Inbox
- Fixed an issue where an inbox fetcher could have a wrong configuration.
1.20.2
This release backports changes from 1.21.1
Inbox
- Fixed an issue where an inbox fetcher could have a wrong configuration.