Interface IProfileDataEditor

Batch's Profile Data Editor. See https://doc.batch.com/ios/custom-data/custom-attributes for more info.

interface IProfileDataEditor {
    addToArray: ((key: string, value: string[]) => IProfileEditor);
    addToTopicPreferences: ((topics: string[]) => IProfileEditor);
    removeAttribute: ((key: string) => IProfileEditor);
    removeFromArray: ((key: string, value: string[]) => IProfileEditor);
    removeFromTopicPreferences: ((topics: string[]) => IProfileEditor);
    setAttribute: ((key: string, value: ProfileAttributeValue) => IProfileEditor);
    setEmailAddress: ((email: undefined | null | string) => IProfileEditor);
    setEmailMarketingSubscription: ((state: "subscribed" | "unsubscribed") => IProfileEditor);
    setLanguage: ((language: undefined | null | string) => IProfileEditor);
    setRegion: ((region: undefined | null | string) => IProfileEditor);
    setTopicPreferences: ((topics: undefined | null | string[]) => IProfileEditor);
}

Properties

addToArray: ((key: string, value: string[]) => IProfileEditor)
addToTopicPreferences: ((topics: string[]) => IProfileEditor)

Add topics to the profile topic preferences.

Type declaration

    • (topics): IProfileEditor
    • Parameters

      • topics: string[]

        Topics to add. Must be a valid List of String not longer than 25 items. String should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 300 characters.

      Returns IProfileEditor

      This object instance, for method chaining.

removeAttribute: ((key: string) => IProfileEditor)
removeFromArray: ((key: string, value: string[]) => IProfileEditor)
removeFromTopicPreferences: ((topics: string[]) => IProfileEditor)

Remove topics from the profile topic preferences.

Type declaration

    • (topics): IProfileEditor
    • Parameters

      • topics: string[]

        Topics to remove. Must be a valid List of String not longer than 25 items. String should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 300 characters.

      Returns IProfileEditor

      This object instance, for method chaining.

setAttribute: ((key: string, value: ProfileAttributeValue) => IProfileEditor)
setEmailAddress: ((email: undefined | null | string) => IProfileEditor)

Associate an email address with this profile.

This requires having a custom user ID registered with the identify API.

Type declaration

    • (email): IProfileEditor
    • Parameters

      • email: undefined | null | string

        must be valid, not longer than 256 characters. It must match the following pattern: ^[^@]+@[A-z0-9-.]+.[A-z0-9]+$. Null to erase.

      Returns IProfileEditor

setEmailMarketingSubscription: ((state: "subscribed" | "unsubscribed") => IProfileEditor)

The profile's marketing emails subscription.

Note that a profile's subscription status is automatically set to unsubscribed when they click an unsubscribe link.

Type declaration

    • (state): IProfileEditor
    • Parameters

      • state: "subscribed" | "unsubscribed"

        You can set it to subscribed or unsubscribed.

      Returns IProfileEditor

setLanguage: ((language: undefined | null | string) => IProfileEditor)

Associate a language with this profile.

Type declaration

    • (language): IProfileEditor
    • Parameters

      • language: undefined | null | string

        must be 2 chars, lowercase, ISO 639 formatted

      Returns IProfileEditor

setRegion: ((region: undefined | null | string) => IProfileEditor)

Associate a region with this profile.

Type declaration

    • (region): IProfileEditor
    • Parameters

      • region: undefined | null | string

        must be 2 chars, uppercase, ISO 3166 formatted

      Returns IProfileEditor

setTopicPreferences: ((topics: undefined | null | string[]) => IProfileEditor)

Set the profile topic preferences.

Type declaration

    • (topics): IProfileEditor
    • Parameters

      • topics: undefined | null | string[]

        List of topics to set. Null to reset. Must be a valid List of String not longer than 25 items. String should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 300 characters.

      Returns IProfileEditor

      This object instance, for method chaining.