Releases: BatchLabs/Batch-Cordova-Plugin
6.0.0
This is a major release, please see our migration guide for more info on how to update your current Batch implementation.
Plugin
- Updated Batch to 2.0. For more information see the ios and android changelog .
- Batch requires iOS 13.0 or higher.
- Batch requires a
minSdk
level of 21 or higher.
Core
- Added method
isOptedOut
to checks whether Batch has been opted out from or not. - Added method
setFindMyInstallationEnabled
to set whether Batch should enable the FindMyInstallation feature or not. - Added method
updateAutomaticDataCollection
to fine-tune the data you authorize to be tracked by Batch. - Removed
canUseAdvertisingIdentifier
property fromConfig
. - Added
migrations
property toConfig
to update the profile migrations related configuration. See our documentation for info. - Fixed an issue where opened push with deeplink was not tracked as direct open on a cold start.
User
- 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 method
clearInstallationData
which allows you to remove the installation data without modifying the current profile.
Event
This version introduced two new types of attribute that can be attached to an event : Array and Object.
- Removed
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 withput
method. - Removed parameter
label
fromtrackEvent
API. You should now use the$label
key inBatchEventAttributes
with theput
method. - Added support for values of type: Array and Object to the
put
method.
Profile
Introduced batch.profile
, a new module that enables interacting with profiles. Its functionality replaces most of BatchUser used to do.
- Added
identify
API as replacement ofbatch.user.getEditor().setIdentifier
. - Added
getEditor
method to get a new instance of aBatchProfileAttributeEditor
as replacement ofBatchUserEditor
. - Added
trackEvent
API as replacement of thebatch.user.trackEvent
methods. - Added
trackLocation
API as replacement of thebatch.user.trackLocation
method.
5.4.0
Plugin
- Updated Batch 1.21.
- Batch requires iOS 12.0 or higher.
- Batch now compiles with and targets SDK 34 (Android 14).
User
- Removed automatic collection of the advertising id. You need to collect it from your side and pass it to Batch via the added
batch.user.getEditor().setAttributionIdentifier(id)
method. - Added
setEmail
method toBatchUserDataEditor
. This requires to have a user identifier registered or to call thesetIdentifier
method on the editor instance beforehand. - Added
setEmailMarketingSubscriptionState
method toBatchUserDataEditor
.
Inbox
- Added
hasLandingMessage
property toInboxNotification
. - Added
displayNotificationLandingMessage
method toInboxFetcher
.
5.3.2
5.3.1
iOS
- Fix
BatchBridgeNotificationCenterDelegate.automaticallyRegister
not being honored. - Add compatibility for Capacitor 4.6: Batch's delegate now tries to register itself at a later time to keep compatibility with Capacitor's push plugins and Batch's features at the same time.
5.3.0
Plugin
- Updated Batch to 1.19.2. Bumping your Android project's compileSdkVersion to 33 might be required. Xcode 13.3 required if your project uses bitcode.
Push
- Added Android implementation of the
batch.push.requestNotificationAuthorization()
API. This allows you to request for the new notification permission introduced in Android 13. See the documentation for more info.
5.1.0
5.0.1
5.0.0
Core
- Breaking change: Fixed an issue where on iOS, the push payload of the
batchPushReceived
event was under thepayload
key. It is now at the root of the event data, just like 2.x and on Android. - Batch Cordova now requires some ES2015 APIs such as promises.
Push
- iOS: Deprecated
registerForRemoteNotifications
by splitting it into two methods:refreshToken
, which should be called on every app start.requestNotificationAuthorization
, which should be called whenever you want to ask the user the permission to display notifications.
- iOS: Added
requestProvisionalNotificationAuthorization
to request a provisional authorization on iOS 11 and higher. - iOS: Calling
setiOSShowForegroundNotifications()
under Capacitor now works as expected.
It works by disabling Capacitor's control of the notification presentation (but Capacitor is still informed of notification events).
Not calling this method preserves Capacitor's handling, which can be configured using@capacitor/push-notifications
. getLastKnownPushToken()
now returns aPromise
rather than taking a callback as a parameter.
Inbox
- The Inbox module has been fully rewritten to reach feature parity with the native SDKs:
batch.inbox.getFetcherForInstallation()
andbatch.inbox.getFetcherForUser()
now return objects that are used to interact with the inbox.- Marking a notification as read, deleted or marking all notifications as read is now supported.
- Fetching multiple pages is now supported.
- Inbox page size and the limit of notifications to fetch are now configurable.
The new fetcher objects MUST be disposed by calling .dispose()
once you are finished with them to free up memory.
See documentation for more info about migrating to the new Inbox API.
User
getInstallationID()
now returns aPromise
rather than taking a callback as a parameter. The promise's result can be undefinied if the Installation ID is unavailable.- Added getters for
language
/region
andidentifier
inbatch.user
.
4.0.0
Plugin
- Changed the Plugin ID from
com.batch.cordova
to@batch.com/cordova-plugin
. This fixes an issue wherecordova prepare
would reinstall an older version of the plugin if the plugins folder was missing.
Cordova users: when updating please remove the old plugin viacordova plugin remove com.batch.cordova
, then install the new one.
Ionic Capacitor users: Nothing needs to be done as Capacitor integrates with NPM and the package.json natively.
Android
- Android 12 compatibility: Added explicit
android:exported
values to the manifest entries added by the plugin.
3.0.0
This is a major release with breaking changes. Please see the migration guide for more info.
Plugin
- Renamed the plugin to
@batch.com/cordova-plugin
. It's cordova internal name is stillcom.batch.cordova
due to cordova limitations.
The plugin cordova name is used when managing plugins after installation. - Updated plugin for recent Cordova/Ionic versions.
Batch Cordova's new version requirements are:- iOS >= 10.0
- Android >= 5.0 (API 21)
- Cordova CLI >= 9.0.0
- Ionic CLI (if used) >= 6.0.0
- cordova-android >= 9.0.0
- cordova-iOS >= 6.0.0
- Updated native Batch SDK to 1.17.0.
Native SDK version can be configured using theBATCHSDK_ANDROID_VERSION
andBATCHSDK_IOS_VERSION
preferences.
Please note that this version of the plugin will not work with earlier native Batch SDK versions. - Added Ionic Capacitor support. Requires Capacitor 2.4 or higher.
- Fixed an issue where Cordova/Ionic would not properly write the required AndroidManifest lines.
- Added support for dates in event data.
- Removed event data tags/attributes limits from the Cordova plugin.
This does not mean that those limits are gone, but that the native SDK will now enforce them so that the plugin doesn't have to be updated if and then these limits change.
Current native limits are 15 attributes and 10 tags.
Android
-
The plugin requires AndroidX to be enabled in your
config.xml
using<preference name="AndroidXEnabled" value="true" />
(Cordova only).
Ionic users will need to addcordova-plugin-androidx-adapter
. -
The plugin doesn't depend on Firebase and appcompat anymore. Batch expects androidx.appcompat and Firebase Cloud Messaging to be in your application.
This can be setup using the Firebase plugin of your choice:- We recommend
cordova-plugin-firebase-messaging
for Cordova.
If you do not want to add Firebase to your iOS app, manual FCM integration steps are available in our integration documentation. - Capacitor comes with appcompat and FCM support out of the box, no extra plugin is needed.
You will also be required to configure your
google-services.json
manually: this is described in the integration documentation and should be covered by your Firebase plugin's documentation. - We recommend
iOS
- The native SDK isn't bundled anymore: Cocoapods is now used to integrate Batch's native component.
- The plugin now automatically sets a UNUserNotificationCenterDelegate to handle new iOS features.
This enables configuration of foreground push behaviour: they can now be displayed in an alert just like if the user was outside of the application.
It can be disabled by callingBatchBridgeNotificationCenterDelegate.automaticallyRegister = false
as soon as possible inapplication:didFinishLaunchingWithOptions:
. - Fixed a bug where notification opens on cold start would not work.
- Fixed multiple mobile landings related bugs.
- Fixed multiple
batchPushReceived
related bugs. - Fixed an issue where boolean custom data was saved as integers.