-
public class BatchProfileAttributeEditor extends InstallDataEditor
Batch Profile Attribute Editor
Profiles centralize data and events from multiple sources (Apps, Websites, APIs) in a single place based on the Custom ID. They also store a profile's email address and email subscriptions.
The Batch Profile Attribute Editor allows you to update profiles to:
Set attributes Set email subscription status and email address Set a language & region
-
-
Method Summary
Modifier and Type Method Description BatchProfileAttributeEditorsetLanguage(@Nullable() String language)Set the language of this profile. BatchProfileAttributeEditorsetRegion(@Nullable() String region)Set the region of this profile. BatchProfileAttributeEditorsetEmailAddress(@Nullable() String email)Set the profile email address. BatchProfileAttributeEditorsetEmailMarketingSubscription(@NonNull() BatchEmailSubscriptionState state)Set the profile email marketing subscription state. BatchProfileAttributeEditorsetPhoneNumber(@Nullable() String phoneNumber)Set the profile phone number. BatchProfileAttributeEditorsetSMSMarketingSubscription(@NonNull() BatchSMSSubscriptionState state)Set the profile SMS marketing subscription state. BatchProfileAttributeEditorsetAttribute(@NonNull() String key, long value)Set a custom profile attribute for a key. BatchProfileAttributeEditorsetAttribute(@NonNull() String key, double value)Set a custom profile attribute for a key. BatchProfileAttributeEditorsetAttribute(@NonNull() String key, boolean value)Set a custom profile attribute for a key. BatchProfileAttributeEditorsetAttribute(@NonNull() String key, @NonNull() Date value)Set a custom profile attribute for a key. BatchProfileAttributeEditorsetAttribute(@NonNull() String key, @NonNull() String value)Set a custom profile attribute for a key. BatchProfileAttributeEditorsetAttribute(@NonNull() String key, @NonNull() URI value)Set a custom profile attribute for a key. BatchProfileAttributeEditorsetAttribute(@NonNull() String key, @NonNull() List<String> value)Set a custom profile attribute for a key. BatchProfileAttributeEditorremoveAttribute(@NonNull() String key)Removes a custom attribute. BatchProfileAttributeEditoraddToArray(@NonNull() String key, @NonNull() String value)Add a string value in the specified array attribute. BatchProfileAttributeEditoraddToArray(@NonNull() String key, @NonNull() List<String> values)Add a list of strings in the specified array attribute. BatchProfileAttributeEditorremoveFromArray(@NonNull() String key, @NonNull() String value)Removes a string from an array attribute.Does nothing if the tag does not exist. BatchProfileAttributeEditorremoveFromArray(@NonNull() String key, @NonNull() List<String> values)Removes a list of strings from an array attribute.Does nothing if the tag does not exist. voidsave()Save all of the pending changes made in that editor.Note if Batch is not started, your changes will be enqueue until it start.Once you called "save", you need to get a new editor in order to make further changes. -
-
Method Detail
-
setLanguage
BatchProfileAttributeEditor setLanguage(@Nullable() String language)
Set the language of this profile.Overrides the detected installation language.
- Parameters:
language- lowercase, ISO 639 formatted string.
-
setRegion
BatchProfileAttributeEditor setRegion(@Nullable() String region)
Set the region of this profile.Overrides the detected installation region.
- Parameters:
region- uppercase, ISO 3166 formatted string.
-
setEmailAddress
BatchProfileAttributeEditor setEmailAddress(@Nullable() String email)
Set the profile email address.
Note: This method requires to already have a registered identifier for the useror to call identify method before this one.
- Parameters:
email- Email address string
-
setEmailMarketingSubscription
BatchProfileAttributeEditor setEmailMarketingSubscription(@NonNull() BatchEmailSubscriptionState state)
Set the profile email marketing subscription state.
Note that profile's subscription status is automatically set to unsubscribed when they clickan unsubscribe link.
- Parameters:
state- State of the subscription
-
setPhoneNumber
BatchProfileAttributeEditor setPhoneNumber(@Nullable() String phoneNumber)
Set the profile phone number.
Note: This method requires to already have a registered identifier for the useror to call identify method before this one.
Example:
Batch.Profile.identify("my_custom_user_id") Batch.Profile.editor().setPhoneNumber("+33123456789").save()- Parameters:
phoneNumber- A valid E.164 formatted string.
-
setSMSMarketingSubscription
BatchProfileAttributeEditor setSMSMarketingSubscription(@NonNull() BatchSMSSubscriptionState state)
Set the profile SMS marketing subscription state.
Note that profile's subscription status is automatically set to unsubscribed when they send a STOP message.
- Parameters:
state- State of the subscription
-
setAttribute
BatchProfileAttributeEditor setAttribute(@NonNull() String key, long value)
Set a custom profile attribute for a key.
- Parameters:
key- Attribute key, can't be null.value- Attribute value.
-
setAttribute
BatchProfileAttributeEditor setAttribute(@NonNull() String key, double value)
Set a custom profile attribute for a key.
- Parameters:
key- Attribute key, can't be null.value- Attribute value.
-
setAttribute
BatchProfileAttributeEditor setAttribute(@NonNull() String key, boolean value)
Set a custom profile attribute for a key.
- Parameters:
key- Attribute key, can't be null.value- Attribute value.
-
setAttribute
BatchProfileAttributeEditor setAttribute(@NonNull() String key, @NonNull() Date value)
Set a custom profile attribute for a key.
- Parameters:
key- Attribute key, can't be null.value- Attribute value, can't be null.
-
setAttribute
BatchProfileAttributeEditor setAttribute(@NonNull() String key, @NonNull() String value)
Set a custom profile attribute for a key.
- Parameters:
key- Attribute key, can't be null.value- Attribute value, can't be null or empty.
-
setAttribute
BatchProfileAttributeEditor setAttribute(@NonNull() String key, @NonNull() URI value)
Set a custom profile attribute for a key.
- Parameters:
key- Attribute key, can't be null.value- Attribute value, can't be null or empty.
-
setAttribute
BatchProfileAttributeEditor setAttribute(@NonNull() String key, @NonNull() List<String> value)
Set a custom profile attribute for a key.
- Parameters:
key- Attribute key, can't be null.value- Attribute value, can't be null or empty.
-
removeAttribute
BatchProfileAttributeEditor removeAttribute(@NonNull() String key)
Removes a custom attribute.Does nothing if it was not set.
- Parameters:
key- Attribute key
-
addToArray
BatchProfileAttributeEditor addToArray(@NonNull() String key, @NonNull() String value)
Add a string value in the specified array attribute. If empty, the collection will automatically be created.
- Parameters:
key- The array attribute to add the value to.value- The value to add.
-
addToArray
BatchProfileAttributeEditor addToArray(@NonNull() String key, @NonNull() List<String> values)
Add a list of strings in the specified array attribute. If empty, the collection will automatically be created.
- Parameters:
key- The array attribute to add the value to.values- The strings to add.
-
removeFromArray
BatchProfileAttributeEditor removeFromArray(@NonNull() String key, @NonNull() String value)
Removes a string from an array attribute.Does nothing if the tag does not exist.
- Parameters:
key- Array attribute namevalue- The value to remove
-
removeFromArray
BatchProfileAttributeEditor removeFromArray(@NonNull() String key, @NonNull() List<String> values)
Removes a list of strings from an array attribute.Does nothing if the tag does not exist.
- Parameters:
key- Array attribute namevalues- The values to remove
-
save
void save()
Save all of the pending changes made in that editor.Note if Batch is not started, your changes will be enqueue until it start.Once you called "save", you need to get a new editor in order to make further changes.
This action cannot be undone.
-
-
-
-