Skip to content

5.0.0

Compare
Choose a tag to compare
@abarisain abarisain released this 13 Oct 14:03
· 73 commits to master since this release

Core

  • Breaking change: Fixed an issue where on iOS, the push payload of the batchPushReceived event was under the payload 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 a Promise 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() and batch.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 a Promise 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 and identifier in batch.user.