Skip to content

2.0.0

Compare
Choose a tag to compare
@arnaud-roland arnaud-roland released this 26 Apr 14:21
· 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 now requires Android min SDK level 21 or higher.

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 like Batch.setConfig(Config config) API. You should now use Batch.start(String apiKey).
  • Removed setCanUseAndroidID method from Config with no equivalent.
  • Removed setCanUseInstanceID method from Config with no equivalent.
  • Removed setShouldAutomaticallyRegisterPush method from Config with no equivalent.
  • Removed setUseAdvancedDeviceInformation method from Config. You should now use the new Batch.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 from Config 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 class BatchUserDataEditor, you should now use Batch.Profile.editor which return an instance of BatchProfileAttributeEditor.
  • 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 from BatchPushPayload.
  • Removed Batch.Push.getLastKnownPushToken. You can now get the whole registration with Batch.Push.getRegistration and use getTokento 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 use Batch.Profile.trackEvent.
  • BatchEventData has been renamed into BatchEventAttributes.
  • Removed addTag API from BatchEventData You should now use the $tags key with putStringList method.
  • Removed parameter label from trackEvent API. You should now use the $label key in BatchEventAttributes with the put(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 to BatchEventAttributes 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 from BatchInboxNotificationContent.

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 of Batch.User.editor().setIdentifier.
  • Added editor method to get a new instance of an BatchProfileAttributeEditor as replacement of BatchUserDataEditor.
  • Added trackEvent APIs as replacement of the Batch.User.trackEvent methods.
  • Added trackLocation API as replacement of the BatchUser.trackLocation method.