Retrieving Platform Information

This topic describes how to retrieve platform information from a Samsung device.

Some API specifications and features vary in implementation between device model groups. To ensure that your application runs on various device models, you need to retrieve the device platform information and implement your application features accordingly.

You can retrieve platform information in 3 ways:

  • Using the Web standard Navigator interface, retrieve the user agent string for the device with the userAgent property:

    var userAgent = navigator.userAgent
    console.log(userAgent);
    

    The user agent string has the following structure:

    Mozilla/$(MOZILA_VER)
    ($(DEVICE_TYPE); $(OS); $(PLATFORM) $(PLATFORM_VER) $(COMPANY_NAME) $(MODEL_NAME))
    AppleWebKit/$(APPLEWEBKIT_VER)
    (KHTML, like Gecko) 
    $(APP_NAME)/$(APP_VER)
    $(UX RECOMMENDED)
    Safari/$(SAFARI_VER)
    

    The following table lists the user agent string fields that have distinctive values for Samsung devices.

    Table 1. User agent field values
    FieldValueRequirement
    $(DEVICE_TYPE)“SMART-TV”Optional
    $(PLATFORM) $(PLATFORM_VER)“Tizen xxx” Mandatory
    $(COMPANY_NAME)“SAMSUNG”Optional
    $(MODEL_NAME)"sdk” for Samsung TV SDK
    $(APP_NAME)/$(APP_VER)Usually “Version/xxx”Mandatory
    $(UX_RECOMMENDED)“TV”Optional

    The user agent strings for Samsung TVs and display devices are listed in the following table.

    Table 2. User agent strings for Samsung devices
    Product User Agent
    2022 models Mozilla/5.0 (SMART-TV; LINUX; Tizen 6.5) AppleWebKit/537.36 (KHTML, like Gecko) 85.0.4183.93/6.6 TV Safari/537.36
    2021 models Mozilla/5.0 (SMART-TV; LINUX; Tizen 6.0) AppleWebKit/537.36 (KHTML, like Gecko) 76.0.3809.146/6.0 TV Safari/537.36
    2019 models Mozilla/5.0 (SMART-TV; LINUX; Tizen 5.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/5.0 TV Safari/537.36
    2018 models Mozilla/5.0 (SMART-TV; LINUX; Tizen 4.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 TV Safari/537.36
    2017 models Mozilla/5.0 (SMART-TV; LINUX; Tizen 3.0) AppleWebKit/538.1 (KHTML, like Gecko) Version/3.0 TV Safari/538.1
    2016 models Mozilla/5.0 (SMART-TV; Linux; Tizen 2.4.0) AppleWebKit/538.1 (KHTML, like Gecko) Version/2.4.0 TV Safari/538.1
  • Using the Samsung Product API, retrieve information about the device, such as the firmware version, the model and the serial number , with the ProductInfo API and the SystemControl API:

    var firmware = webapis.productinfo.getFirmware();
    console.log(firmware);
    
    var model = webapis.productinfo.getModel();
    console.log(model);
    
    var serialNumber = webapis.systemcontrol.getSerialNumber();
    console.log(serialNumber);
    
  • Using the Tizen API, retrieve the Tizen version with the SystemInfo API:

    var capability = tizen.systeminfo.getCapability('http://tizen.org/feature/platform.version');
    console.log(capability);