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
.