Skip to content

Retrieving User Properties

Description

This operation allows retrieving user properties from the BackendlessUser object stored locally in the client application.

Method

// retrieves property value for the specified name identified by the "key" argument
public object GetProperty( string key )

// get a complete collection of the user object properties
public Dictionary<string, object> Properties;

Return Value

An object containing properties and corresponding values.

{  
  "propName1" : value,  
  "propName2": value,   
}

Example

The example below logs in as "alice@yourmail.com" and retrieves the phoneNumber user property.

BackendlessUser user = // Logs in to the "alice@yourmail.com" identity and retrieves the BackendlessUser object 

// get the value of the "phoneNumber" property
String phoneNumber = (String) user.Properties[ "phoneNumber" ];

// alternatively, the property can be obtained as:
String phoneNumber2 = (String) user.GetProperty( "phoneNumber" );