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);
    removeAttribute: ((key: string) => IProfileEditor);
    removeFromArray: ((key: string, value: 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);
}

Properties

addToArray: ((key: string, value: string[]) => IProfileEditor)
removeAttribute: ((key: string) => IProfileEditor)
removeFromArray: ((key: string, value: string[]) => IProfileEditor)
setAttribute: ((key: string, value: ProfileAttributeValue) => IProfileEditor)
setEmailAddress: ((email: undefined | null | string) => IProfileEditor)

Associate an email address to this profile.

This requires to have 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 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 to 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 to this profile.

Type declaration

    • (region): IProfileEditor
    • Parameters

      • region: undefined | null | string

        must be 2 chars, uppercase, ISO 3166 formatted

      Returns IProfileEditor