Releases: BatchLabs/Batch-Web-SDK
Releases · BatchLabs/Batch-Web-SDK
4.1.1
4.1.0
Core:
- Batch will now start even if the current browser does not support push messaging features.
Core - Service worker:
- Batch will now detect if the ServiceWorker isn't setup as expected and breaks the SDKs functionality.
4.0.0
This is a major release, please see our Migration Guide for more info on what changed since 3.x.
Core:
- Added builtin German translations.
- Added optional
defaultDataCollection
configuration object to the Batch'ssetup
method. This allows you to enable the geoip back-end resolution for the user'sregion
attribute which is now disabled by default. - Added optional
migrations
configuration object to the Batch'ssetup
method. This allows you to disable data migrations to the new Batch user-centric data model (enabled by default).
Core - Service worker:
- Moved Service Worker related configuration keys in a
serviceWorker
object. automaticallyRegister
replaceduseExistingServiceWorker
. Set it tofalse
to prevent Batch from automatically registering
its worker. Default:true
.waitTimeout
replacesserviceWorkerTimeout
but works the same.registration
allows you to have Batch use a specific Service Worker registration.
This can be a Service Worker registration for a sub-scope that does not control the current page.
Be careful: Batch can't check that this SW will properly work, your integration might break if your SW is not valid for push
notifications.
Usingregistration
requiresautomaticallyRegister
to be false. Not setting it defaults tonavigator.serviceWorker.ready
.serviceWorkerPathOverride
has been removed: manually register a service worker with your custom path and give the
Promise to the SDK inregistration
.
Core - User/Profile:
In the past, data was siloed between different platforms. However, Projects remove this limitation by introducing profiles. Each Project is associated with a unified userbase made up of profiles. When users interact with any of the platforms (website, iOS app, Android app...) within a Project, their actions are fed into the associated Profiles.
Web SDK v4 APIs are fully compatible with profiles and allow you to set attributes and events on omnichannel profiles:
- Removed
setCustomUserID
API (has been replaced withidentify
). - Removed
getCustomUserID
API. (no equivalent) - Removed
setUserLanguage
API (has been replaced withsetLanguage
). - Removed
setUserRegion
API (has been replaced withsetRegion
). - Removed
editUserData
API (has been replaced withedit
). - Removed
IUserDataEditor
interface. (has been replaced withIProfileDataEditor
). - Removed
addTag
API (has been replaced withaddToArray
). - Removed
removeTag
API (has been replaced withremoveFromArray
). - Updated
trackEvent
parameters (EventDataParams
):- Added support for
Array
andObject
attribute types. - Replaced optional
tag
attribute with$tags
as reserved key under theattributes
object. - Replaced optional
label
attribute with$label
as reserved key under theattributes
object.
- Added support for
- Added
profile
API to get the public profile module. Please see API references for more info. - Added
identify
API underIBatchProfile
as replacement ofsetCustomUserID
. - Added
edit
API underIBatchProfile
as replacement ofeditUserData
. - Added
setEmailAddress
API (this requires to have a custom user ID registered). - Added
setEmailMarketingSubscription
API. - Added
setLanguage
API underIProfileDataEditor
as replacement ofsetUserLanguage
. - Added
setRegion
API underIProfileDataEditor
as replacement ofsetUserRegion
. - Added
clearInstallationData
API. Clear all related data to the user's installation and wipe user's local data. This doesn't affect profile's data.
3.5.0
3.4.0
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.1
3.3.0
🎉 First source available release
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 callapi.subscribe()
.