userPreferences.setting()

    userPreferences.setting()


    Article summary

    userPreferences.setting()

    Mandatory Integration:

    Must be called prior to sharing viewing data via accountLink.mediaEvent(). If TRUE, viewing data may be shared. If FALSE, viewing data may not be shared. See Personalization on X1 for additional details.

    userPreferences.setting()

    Retrieves information about the users preferences settings. A key is passed as a parameter that corresponds to a specific user preference setting. These preferences hold a boolean or string value set in the device.

    For example: Recommendations Based on History, Recently Viewed Content, etc., would have the values true or false. Device Friendly Name would have values like “Living Room”.

    Signature:

    $badger.userPreferences().setting($badger.PREFERENCES.<KEY>)

    Parameters:

    ParameterDescriptionTypeRequired
    $badger.PREFERENCES.<KEY>The key to a specific user setting. Can be one of the following:
    CLOSED_CAPTIONING
    VOICE_GUIDANCE
    RECOMMENDATIONS_BASED_ON_HISTORY
    RECENTLY_VIEW_CONTENT
    DEVICE_FRIENDLY_NAME
    SHARE_WATCH_HISTORY_STATUS
    ConstantYes

    Return Values:

    Using the above method returns a boolean status of true or false for each specific setting in the device.

    After calling the function, the return value can be accessed through the 1st parameter of the success callback as:

    setting.enabled (The value will be: true or false. Applies to CLOSED_CAPTIONING, VOICE_GUIDANCE, RECOMMENDATIONS_BASED_ON_HISTORY and RECENTLY_VIEW_CONTENT, and SHARE_WATCH_HISTORY_STATUS)

    setting.value (Applies to DEVICE_FRIENDLY_NAME)

    Usage Example:

    $badger.userPreferences().setting($badger.PREFERENCES.RECENTLY_VIEW_CONTENT).success(function(setting) { 
         recently_view_content_enabled = setting.enabled; 
    }) 
    .failure(function() { 
         ...
    });
    
    $badger.userPreferences().setting($badger.PREFERENCES.DEVICE_FRIENDLY_NAME).success(function(setting) {
         device_friendly_name = setting.value;
    }) 
    .failure(function() { 
         ...
    });
    

    Was this article helpful?