UserExtendedProperties.GetValue Method
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.
Assembly: Microsoft.Phone (in Microsoft.Phone.dll)
Parameters
- propertyName
- Type: System.String
The name of the user property to be retrieved. Property names are case-sensitive.
| 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:
|
|---|
|
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);
Important Note: