SDK changelog

Change log and release notes for the Batch SDK.

Minor and patch releases are automatically rolled out to pages. You can upgrade between major versions by changing the version of the script included in your webpage:

  • Look for https://via.batch.com/v3/bootstrap.min.js in the script tag, where v3 is the major version.
  • Your service worker file also needs to be updated to match the tag's version, or the SDK might fail to start and/or display notifications.

3.5.023/02/2023Download

Core:

  • Changed rules used to determine whether events should be sent immediately to Batch's backend or enqueued.

Safari:

  • Enabled iOS Web Push. Requires iOS 16.4+ and for the PWA to be installed as a standalone app.

3.4.022/11/2022Download

Core:

  • subdomain is now optional in the configuration object. Previously, omitting subdomain resulted in notifications not showing their icon and image and failing to open the website on click.

Safari:

  • Batch now uses Web Push Protocol as default on Safari if a user is not already subscribed with APNS.

UI:

  • The alert UI component now supports adding a configurable "extra" button in its configuration. See the documentation for more info.

UI:

  • Fixed an issue where the native UI component would not automatically resubscribe a user if the backoff duration was not elapsed.

3.3.108/07/2022Download

Core:

  • Improved validation of susbcriptions before they're sent to Batch's servers.

Safari:

  • Fixed an issue where UI Components would be stuck "loading" even after a user granted or denied the push permission due to a Safari bug.

3.3.003/05/2022Download

Core:

  • Added api.refreshServiceWorkerRegistration() to re-synchronize Batch's internal state with the current Service Worker registration.
  • Added api.doesExistingSubscriptionKeyMatchCurrent() to check if the current Service Worker (if there is one) registration's push applicationServerKey matches the one Batch is configured with.

See their jsdoc for more info.

User:

  • Optimize custom data sync if no data has been set.

UI Components:

  • Added the showIfPermissionGranted (boolean, default: true) configuration option on the Alert format. Setting it to false will make it so Alert doesn't show if the user has already granted the notification permission, even if they're not subscribed to Batch. In that case, they will not be automatically resubscribed until you call api.subscribe().

3.2.006/04/2022Download

User:

  • Added support for custom attributes and tags. See the documentation for more info.

3.1.017/03/2022Download

User:

  • Added support for custom events.
    See the documentation for more info.

3.0.316/12/2021Download

Core:

  • Enhance compatibility of UI Components with AMP pages with the Custom Elements polyfill applied.

UI Components:

  • Fix a regression on the alert UI Component where styling might not be applied properly

3.0.208/12/2021Download

Core:

  • Worked around an issue where the SDK would not start on websites where DOMContentLoaded is not bubbled.

3.0.117/11/2021Download

This is a major release, please see our Migration Guide for more info on what changed since 2.x.

Core:

  • Added support for Safari push notifications. This requires additional configuration on Batch's dashboard and the SDK's configuration: see our documentation for more info. Safari 12 or higher is required.
  • Removed support for HTTP/Multidomain mode (sameOrigin becomes deprecated, remove it to the SDK configuration). This requires a change to the SDK configuration: see our migration guide for more info.
  • defaultIcon and smallIcon are now optional and can be remotely configured using Batch's dashboard. Setting your own URLs is still supported.

UI Components:

  • If the defaultIcon image cannot be loaded, UI components will now hide the image rather than display the browser’s generic broken image placeholder.

2.3.022/11/2022Download

Core:

  • Ensure SDK stays disabled on future iOS versions. As of writing, v2 doesn't start on any iOS version: if you want to support iOS when web push becomes supported by Apple, please use the v3 or higher.

2.2.216/12/2021Download

Core:

  • Enhance compatibility of UI Components with AMP pages with the Custom Elements polyfill applied.
  • Worked around an issue where the SDK would not start on websites where DOMContentLoaded is not bubbled.
  • Fix an issue where the current "dev" config value was not logger properly.

2.2.115/09/2021Download

UI Components:

  • Fix an issue where alert styling would not be applied properly.

2.2.009/09/2021Download

Bumped minimal browser versions:

  • Edge (Old) 16 (unchanged)
  • Chrome 55 (previously 50)
  • Firefox 53 (previously 46)
  • Edge Chromium 77

Core:

  • Added getConfiguration(), which gets a readonly copy of the SDK configuration for debugging.
  • Better logging of service worker registration errors.
  • Added webp images for Firefox.
  • Fixed an issue where calling setup twice resulted in unexpected behaviour.

User:

  • set/get UserLanguage/UserRegion/CustomUserID's type checking have been improved:
    • They can no longer return undefined: They will always return null if not set.
    • They accept both null and undefined to unset their values.
  • Updated getInstallationID definition to match that it could never return null

UI Components:

  • Fix various theming issues on the button format.
  • Additional stable identifiers have been introduced on multiple formats.
  • Added a ui component that can display the public identifiers (Installation ID, Custom User ID, ...).
    It can be shown by calling batchSDK('ui.showPublicIdentifiers')
  • Fixed a bug on Chrome where the native notification permission popup could be displayed twice if the user dismissed it.

Messaging:

  • Removed support for opening deeplinks in a pre-existing tab. A new tab is now always opened.

2.1.022/11/2018Download

Core:

  • Reworked how including our service worker is done. It will now be automatically updated to the latest version. This also gets rid of the async importScripts which could cause issues in a shared service worker environment.

Note: This version comes with an update to the service worker loader and shared worker implementation. You will have to redownload batchsdk-worker-loader.js and deploy it to your website. If using the shared worker, download batchsdk-shared-worker.js and replace your existing setupSharedBatchSDK method with the new one.

If you rely on a shared service worker implementation, please upgrade ASAP to stay compatible with latest Chrome and Firefox versions.

2.0.923/10/2018

Core:

  • Fix an issue where the registration token would not be immediatly sent to the server, if the service worker had been unregistered by a 3rd party
  • Fix an issue where calling Batch's API would fail if called before the SDK is ready. Calls will now be enqueued properly.

UI Components:

  • Fix popin's title propery not being honored in configuration.

2.0.812/09/2018

UI Components:

  • Improved button format rendering on mobile devices.
  • Replaced header tags from UI components with more simple tags.
  • Fixed banner's left position.
  • Fixed a Firefox bug where alert might never appear.
  • Implement pushsubscriptionchange on the ServiceWorker
  • Lazy load help images for browser permission re-optin
  • Help images are now available in webp for chrome, and their PNG versions have been optimized

2.0.618/05/2018

  • Fix a link replacement bug in the popin UI component

2.0.514/03/2018

  • Fix Alert buttons not showing up on Chrome 58 and lower.

2.0.409/03/2018

  • Fix RTL text alignment on the Alert format
  • Fix some UI components not working anymore with Chrome 60 and lower

2.0.308/12/2017

  • Fix an issue where opening a notification in Chrome would not do anything

2.0.101/12/2017

  • Fix a registration bug with Chrome 62+ in multidomain/insecure mode
  • Fix an issue where the button's example push would show incorrectly

2.0.029/11/2017

  • Added a new UI component format: Alert
  • The "button" UI component now supports configuring a preview of the push notifications users rather than a placeholder
  • The "button" UI component now supports changing the bell's hover color, using the hoverForegroundColor configuration key
  • Exposed the previously undocumented "ui" object of the SDK's public API.
  • Most UI components now support a autoShow configuration option, preventing them to be automatically shown. (usage. ui:{ banner: { autoShow: false } })
  • Banner's hideFor default value is now 7 days
  • Added "ui.show", and "ui.hide" methods, allowing developers to have control over when UI components should be displayed. Should be used with autoShow: false. (usage: batchSDK("ui.show", "banner"))