Batch
BatchSDK.User.Editor Class Reference

User data editor; This is the class you'll interact with to make changes to user attributes, such as: More...

Public Member Functions

Editor SetLanguage (string language)
 Override the auto-detected language of this user. More...
 
Editor SetRegion (string region)
 Override the auto-detected region of this user. More...
 
Editor SetIdentifier (string identifier)
 Set the user identifier. Be careful: you should make sure the identifier uniquely identifies a user. When pushing an identifier, all installations with that identifier will get the Push, which can cause some privacy issues if done wrong. More...
 
Editor SetAttribute (string key, long val)
 Set a custom user attribute for a key. More...
 
Editor SetAttribute (string key, double val)
 Set a custom user attribute for a key. More...
 
Editor SetAttribute (string key, DateTimeOffset val)
 Set a custom user attribute for a key. More...
 
Editor SetAttribute (string key, string val)
 Set a custom user attribute for a key. More...
 
Editor RemoveAttribute (string key)
 Remove an attribute. More...
 
Editor ClearAttributes ()
 Clear all attributes (Tags are unaffected). More...
 
Editor AddTag (string collection, string tag)
 Add a tag to a tag collection. More...
 
Editor RemoveTag (string collection, string tag)
 Remove a tag from a tag collection. More...
 
Editor ClearTagCollection (string collection)
 Clear the specified tag collection. More...
 
Editor ClearTags ()
 Clear all tags (Attributes are unaffected). More...
 
Editor Save ()
 Save the changes in the background. More...
 

Detailed Description

User data editor; This is the class you'll interact with to make changes to user attributes, such as:

  • Custom language/region/identifier
  • Attributes
  • Tags

Member Function Documentation

Editor BatchSDK.User.Editor.AddTag ( string  collection,
string  tag 
)

Add a tag to a tag collection.

Parameters
collectionTag collection name. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters.
tagTag value. Must not be null and can't be longer than 64 characters.
Returns
The same editor instance, for method chaining
Editor BatchSDK.User.Editor.ClearAttributes ( )

Clear all attributes (Tags are unaffected).

Returns
The same editor instance, for method chaining
Editor BatchSDK.User.Editor.ClearTagCollection ( string  collection)

Clear the specified tag collection.

Does nothing if the collection didn't exist.

Parameters
collectionName of the tag collection to clear.
Returns
The same editor instance, for method chaining
Editor BatchSDK.User.Editor.ClearTags ( )

Clear all tags (Attributes are unaffected).

Returns
The same editor instance, for method chaining
Editor BatchSDK.User.Editor.RemoveAttribute ( string  key)

Remove an attribute.

Does nothing if the attribute didn't exist.

Parameters
keyAttribute key, can't be null.
Returns
The same editor instance, for method chaining
Editor BatchSDK.User.Editor.RemoveTag ( string  collection,
string  tag 
)

Remove a tag from a tag collection.

Does nothing if the tag didn't exist.

Parameters
collectionTag collection name. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters.
tagTag value. Must not be null and can't be longer than 64 characters.
Returns
The same editor instance, for method chaining
Editor BatchSDK.User.Editor.Save ( )

Save the changes in the background.

Batch must be started in order to call this method.

Returns
The same editor instance, for method chaining
Editor BatchSDK.User.Editor.SetAttribute ( string  key,
long  val 
)

Set a custom user attribute for a key.

Parameters
keyAttribute key, can't be null. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters.
valAttribute long value
Returns
The same editor instance, for method chaining
Editor BatchSDK.User.Editor.SetAttribute ( string  key,
double  val 
)

Set a custom user attribute for a key.

Parameters
keyAttribute key, can't be null. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters.
valAttribute double value
Returns
The same editor instance, for method chaining
Editor BatchSDK.User.Editor.SetAttribute ( string  key,
DateTimeOffset  val 
)

Set a custom user attribute for a key.

Parameters
keyAttribute key, can't be null. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters.
valAttribute DateTimeOffset value
Returns
The same editor instance, for method chaining
Editor BatchSDK.User.Editor.SetAttribute ( string  key,
string  val 
)

Set a custom user attribute for a key.

Parameters
keyAttribute key, can't be null. It should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 30 characters.
valAttribute string value: can't be null or longer than 64 characters
Returns
The same editor instance, for method chaining
Editor BatchSDK.User.Editor.SetIdentifier ( string  identifier)

Set the user identifier. Be careful: you should make sure the identifier uniquely identifies a user. When pushing an identifier, all installations with that identifier will get the Push, which can cause some privacy issues if done wrong.

Parameters
identifierUser identifier string. null to reset.
Returns
The same editor instance, for method chaining
Editor BatchSDK.User.Editor.SetLanguage ( string  language)

Override the auto-detected language of this user.

Parameters
languageLowercase language code, conforming to ISO 639. null to reset.
Returns
The same editor instance, for method chaining
Editor BatchSDK.User.Editor.SetRegion ( string  region)

Override the auto-detected region of this user.

Parameters
regionUppercase region code, conforming to ISO 3166. null to reset.
Returns
The same editor instance, for method chaining