Releases: BatchLabs/Batch-Android-SDK
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
Configclass has been removed with all related methods likeBatch.setConfig(Config config)API. You should now useBatch.start(String apiKey). - Removed
setCanUseAndroidIDmethod fromConfigwith no equivalent. - Removed
setCanUseInstanceIDmethod fromConfigwith no equivalent. - Removed
setShouldAutomaticallyRegisterPushmethod fromConfigwith no equivalent. - Removed
setUseAdvancedDeviceInformationmethod fromConfig. You should now use the newBatch.updateAutomaticDataCollectionAPI. Please see our documentation for more information. - Removed
Batch.getApiKeywith no equivalent. - Removed
Batch.shouldUseGoogleInstanceIDwith no equivalent. - Removed
Batch.shouldAutoRegisterForPushwith no equivalent. - Removed
Batch.isRunningInDevModewith no equivalent. - Removed
Batch.shouldUseAdvancedDeviceInformationwith 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
setCanUseAdvertisingIDmethod fromConfigwhich was a no-op. - Removed
Batch.shouldUseAdvertisingIDwhich was a no-op. - Removed
Batch.getAdvertisingIDwhich was a no-op. - Removed class
AdsIdentifierProvider. - Removed class
AdsIdentifierProviderAvailabilityException. - Removed class
AdsIdentifierProviderAvailabilityException.
Core - New APIs
- Added
Batch.updateAutomaticDataCollectionto 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
printDebugInformationwith no equivalent. - Removed method
trackTransactionwith no equivalent. - Removed method
Batch.User.editorand the related classBatchUserDataEditor, you should now useBatch.Profile.editorwhich 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
getPriorityfromBatchPushPayload. - Removed
Batch.Push.getLastKnownPushToken. You can now get the whole registration withBatch.Push.getRegistrationand usegetTokento 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_overrideAndroidManifest 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
trackEventAPIs from the user module. You should now useBatch.Profile.trackEvent. BatchEventDatahas been renamed intoBatchEventAttributes.- Removed
addTagAPI fromBatchEventDataYou should now use the$tagskey withputStringListmethod. - Removed parameter
labelfromtrackEventAPI. You should now use the$labelkey inBatchEventAttributeswith 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
validateEventAttributesmethod toBatchEventAttributeswhich return a list of human-readable errors to ensure your event attributes are valid before sending them.
Inbox
- Removed deprecated
Batch.Inbox.getFetchermethod. - Removed deprecated
isDeletedmethod fromBatchInboxNotificationContent.
Profile
Introduced Profile, a new module that enables interacting with profiles. Its functionality replaces most of the User module used to do.
- Added
identifyAPI as replacement ofBatch.User.editor().setIdentifier. - Added
editormethod to get a new instance of anBatchProfileAttributeEditoras replacement ofBatchUserDataEditor. - Added
trackEventAPIs as replacement of theBatch.User.trackEventmethods. - Added
trackLocationAPI as replacement of theBatchUser.trackLocationmethod.
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.
1.21.0
BREAKING
- Removed support for optional Play Core library. You should now use the Play In-App Review Library. Please see our documentation for more info.
Core
- Removed automatic collection of AAID (Android Advertising Identifier).
setCanUseAdvertisingIDis now a no-op. You need to collect it from your side and pass it to Batch via the addedBatch.User.editor().setAttributionIdentifier(id)method.
Push
- To help with FCM v1 API migration, the SDK will send the GCP Project ID associated to the FCM Token to Batch's backend. This is not supported in legacy GCM/FCM Instance ID modes.
1.20.1
User
- Fixed an issue on
BatchUserDataEditorwhere data wasn't sent when usingsetEmailorsetEmailMarketingSubscriptionState.
1.20.0
Core
- Batch now compiles with and targets SDK 34 (Android 14 'Upside Down Cake').
- Fixed a rare issue where the SDK could trigger an ANR on start when upgraded from an older version.
Push
- Improved notification image by making notifications taller if possible and changing scaling type to Center Fit.
User
- Added
Batch.User.editor().setEmail(email)method. This requires to have a user identifier registered or to call thesetIdentifiermethod on the editor instance beforehand. - Added
Batch.User.editor().setEmailMarketingSubscriptionState(BatchEmailSubscriptionState)method to subscribe to the email marketing list.
Inbox
- Added the ability to know if a
BatchLandingMessagehas been displayed from the inbox via theisDisplayedFromInbox()method. - Added the ability to know if a notification has a landing message attached on
BatchInboxNotificationContentusing thehasLandingMessage()method. - Added the ability to display a landing message attached to a
BatchInboxNotificationContentusing thedisplayLandingMessage(context)method.
1.19.4
Messaging
- Fixed an issue for In-App Webview format where Batch would get the wrong deeplink url for an image embedded into a hyperlink.
1.19.3
Core
- Fixed an issue where Batch would crash when advertising ID collection is enabled and the Firebase Messaging library is not present
1.19.2
Core
- Batch now compiles with and targets SDK 33 (Android 13).
- Improved support for Android 13 Tiramisu.
- Added a new API:
Batch.Push.requestNotificationPermission(context). This allows you to request for the new notification permission introduced in Android 13. See the documentation for more info. - Fixed an issue where
BatchNotificationChannelsManager.openSystemChannelSettings(context)wasn't working with an application context.
Actions
- Added
batch.android_smart_reoptin, which asks the user the notification permission or redirect to the notification settings. - Added
batch.android_redirect_settings, which redirects the user to the notification settings.