Search code examples
javascriptuwpxbox-one

Is the "Access to content" value from the Xbox One settings available through the Javascript UWP api?


We're developing a UWP application for Xbox One. We'd like to filter content within the application, by checking the current user's content restrictions.

We were hoping to be able to get a lower age rating for our application by filtering any content above the user's Access to content setting, which can be found at Settings->Account->Content restrictions->Access to content. However, we can't find any properties representing this setting in the Javascript api.

Is it possible to retrieve the value of this setting from the Javascript UWP platform?


Solution

  • After a lot of searching and experimenting I was finally able to find a solution:

    Windows.Media.ContentRestrictions.RatedContentRestrictions()
        .getBrowsePolicyAsync()
        .then(function (result) {
            /* 
             * "result" contains a ContentRestrictionsBrowsePolicy object which 
             * provides all the information I need.
             */
        });
    

    Have a look at the ContentRestrictionsBrowsePolicy class for more information.