×

CountryResolver class

This document covers the CountryResolver class, which is for advanced use. The class validates that a country has availability for the Nokia MixRadio API.

By default, the phone Region settings are used and checked with each API call made.

The CountryResolver constructor

Initializes a new instance of the CountryResolver class.

Table 1. CountryResolver Constructor Parameters
Name Description
clientId Your Client ID (used to be called App ID) -- see Authentication.

Example

CountryResolver resolver = new CountryResolver(MyAppId);

The CheckAvailability method

We require a country code for main API calls to filter the availability of our content (see Availability for more information).

This method validates that the Nokia MixRadio API is available for a given country. If you get a true response indicating the API is available, you should cache the countryCode for future usage -- for example, in a phone application storage area.

Table 2. CheckAvailability Parameters
Name Description
callback The delegate to call once a response has been received.
countryCode An ISO3166-2 country code to validate.

Result type

bool

Example

The following example checks if Nokia MixRadio is available for the user by using value of the device RegionInfo.CurrentRegion.TwoLetterISORegionName property.

bool available = await resolver.CheckAvailabilityAsync(RegionInfo.CurrentRegion.TwoLetterISORegionName.ToLower());
if (response.Result)
{
    MessageBox.Show(@"Hooray! Nokia MixRadio is available");
}
else
{
    MessageBox.Show(@"Sorry, Nokia MixRadio is not available");
}


Last updated 20 November 2013

Back to top

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×