[This is preliminary documentation and is subject to change.]

Sets the demographic restrictions for the application.

Namespace:  Facebook.Api.Controllers
Assembly:  Facebook (in Facebook.dll) Version: 0.2009.3.23 (0.2009.3.23)

Syntax

C#
public FacebookResponse<bool> SetRestrictionInfo(
	string restrictionStr
)
Visual Basic (Declaration)
Public Function SetRestrictionInfo ( _
	restrictionStr As String _
) As FacebookResponse(Of Boolean)
Visual C++
public:
FacebookResponse<bool>^ SetRestrictionInfo(
	String^ restrictionStr
)

Parameters

restrictionStr
Type: System..::.String
A JSON-encoded string of the restricting attributes. Restrictions include
CopyC#
age
,
CopyC#
location
,
CopyC#
age_distribution
, and
CopyC#
type
. If you use the Facebook PHP client library, you can actually pass an associative array and Facebook automatically handles the JSON encoding. For example:
CopyC#
{"age_distribution":"{\"CA,US\":\"16-25\",\"IN\":\"15-20,30+\"}"}
.

When specifying the
CopyC#
age
or
CopyC#
age_distribution
, you can use plus (+) and minus (-) to restrict content to that age or older/younger (like 21+ for 21 and older or 18- for younger than 19). You can also specify a range of ages, like 18-35 so anyone between the ages of 18 and 35 (inclusive) can see the content. You can also specify multiple age ranges (like 19-,30+ -- if you want to exclude people in their 20s, for example). Every specified age must be an integer.

When specifying the
CopyC#
location
, specify the country or countries (using a comma-separated list) from the ISO 3166 alpha 2 code list. This list is not necessarily the same as the IANA ccTLD (country code top level domain) list. For example, the ISO 3166 entry for England is
CopyC#
.gb
, while the IANA entry is
CopyC#
.uk
.

Specifying a
CopyC#
type
allows you to target users based on age and location for custom made categories like
CopyC#
alcohol
(currently the only type available). Before rendering your FBML, we run a check against the
CopyC#
type
on Facebook, and if the user meets the age and location requirements, we'll render the content.

Return Value

[Missing <returns> documentation for "M:Facebook.Api.Controllers.AdminController.SetRestrictionInfo(System.String)"]

See Also

AdminController Class
SetRestrictionInfo Overload
Facebook.Api.Controllers Namespace