1 out of 2 rated this helpful - Rate this topic

UserExtendedProperties.GetValue Method

Windows Phone

March 22, 2012

Retrieves an object representing the specified user property. In the current release, the only supported property is "ANID".

The UserExtendedProperties API should only be used by applications that use the Microsoft Advertising SDK for Windows Phone.

Namespace:  Microsoft.Phone.Info
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)
public static Object GetValue(
	string propertyName
)

Parameters

propertyName
Type: System.String
The name of the user property to be retrieved. Property names are case-sensitive.

Return Value

Type: System.Object
Returns Object.
Exception Condition
ArgumentNullException

The specified property name is null.

ArgumentOutOfRangeException

The specified property does not exist.

UnauthorizedAccessException

The capability to retrieve the property has not been granted.

NotSupportedException

The specified property cannot be retrieved.

GetValue(String) will either return a non-null object containing the requested value or it will throw one of the exceptions listed below. TryGetValue(String, Object) provides the same functionality as GetValue(String), but uses a different syntax you may prefer.

Important note Important Note:

UserExtendedProperties requires the user identity capability. If your application uses this class, the user will be alerted that the application requires access to the value associated with the user’s identity when viewing your application on Windows Phone Marketplace. For this reason, we recommend that you use this class only if your application requires it.

The string returned when querying for the anonymous ID by specifying the “ANID” property name contains the 32-character anonymous identifier as well as other information used by the system. To extract only the anonymous identifier, use the following code.

string anid = UserExtendedProperties.GetValue("ANID") as string;
string anonymousUserId = anid.Substring(2, 32);

Windows Phone OS

Supported in: 7.1, 7.0

Windows Phone

Did you find this helpful?
(1500 characters remaining)