Implements

  • Batch

Constructors

Properties

inbox: InboxModule

Inbox module

messaging: MessagingModule

Messaging module

profile: ProfileModule

User module

push: PushModule

Push module

user: UserModule

User module

Methods

  • Checks whether Batch has been opted out from or not.

    Returns Promise<boolean>

    A promise that resolves to a boolean value indicating whether Batch has been opted out from or not.

  • Unregisters all listeners for a given event, or all events.

    Parameters

    • Optional_event: string

    Returns void

  • Registers a listener for a given event. Multiple listeners can be set on an event.

    Parameters

    • _event: string
    • _listener: ((eventName: string, parameters: {
          [key: string]: unknown;
      }) => void)
        • (eventName, parameters): void
        • Parameters

          • eventName: string
          • parameters: {
                [key: string]: unknown;
            }
            • [key: string]: unknown

          Returns void

    Returns void

  • Opt In to Batch SDK Usage.

    This method will be taken into account on next full application start (full process restart)

    Only useful if you called batch.optOut() or batch.optOutAndWipeData() or opted out by default in the manifest

    Some features might not be disabled until the next app start if you call this late into the application's life. It is strongly advised to restart the application (or at least the current activity) after opting in.

    Returns void

  • Opt Out from Batch SDK Usage

    Note that calling the SDK when opted out is discouraged: Some modules might behave unexpectedly when the SDK is opted-out from.

    Opting out will:

    • Prevent batch.start()
    • Disable any network capability from the SDK
    • Disable all In-App campaigns
    • Make the Inbox module return an error immediatly when used
    • Make the SDK reject any editor calls
    • Make the SDK reject calls to batch.user.trackEvent(), batch.user.trackTransaction(), batch.user.trackLocation() and any related methods

    Even if you opt in afterwards, data that has been generated while opted out WILL be lost.

    If you're also looking at deleting user data, please use batch.optOutAndWipeData()

    Note that calling this method will stop Batch. Your app should be prepared to handle these cases. Some features might not be disabled until the next app start.

    Returns void

  • Opt Out from Batch SDK Usage

    Same as batch.optOut(Context) but also wipes data.

    Note that calling this method will stop Batch. Your app should be prepared to handle these cases.

    Returns void

  • Set Batch's config. You're required to call this before start.

    If you don't want to specify one of the configuration options, simply omit the key.

    Parameters

    • _config: Config

    Returns void

  • Control whether Batch should enable the Find My Installation feature (default = true)

    If enabled Batch will copy the current installation id in the clipboard when the application is foregrounded 5 times within 12 seconds.

    Parameters

    • _enabled: boolean

    Returns void

  • Start Batch. You need to call setConfig beforehand.

    Returns void

  • Update the SDK Automatic Data Collection.

    Parameters

    • _dataCollection: DataCollectionConfig

    Returns void

    DataCollectionConfig for more info.

    Here's an example:

    batch.updateAutomaticDataCollection({
    geoIP: false, // Deny Batch from resolving the user's region from the ip address.
    deviceModel: true // Authorize Batch to use the user's device model information.
    });

    Batch will persist the changes, so you can call this method at any time according to user consent.