Mobile native Wearable native

Privilege Info: Managing Privilege Information

This tutorial demonstrates how you can display privilege information, such as the name and description of a given privilege.

Warm-up

Become familiar with the Privilege Info API basics by learning about:

Getting Privilege Information

To get privilege display information:

  1. To use the functions and data types of the Privilege Info API (in mobile and wearable applications), include the <privilege_information.h> header file in your application:

    #include <privilege_information.h>
    
  2. To get various privilege information:
    1. Get the privilege display name using the privilege_info_get_display_name() function. The parameters are the API version, privilege name, and privilege display name.
      char* displayName = NULL;
      int retVal = privilege_info_get_display_name("2.2", "http://tizen.org/privilege/application.launch", &displayName);
    2. Get the privilege display name by package type using the privilege_info_get_display_name_by_pkgtype() function. The parameters are the package type, API version, privilege name, and privilege display name.
      char* displayName = NULL;
      int retVal = privilege_info_get_display_name_by_pkgtype("PRVINFO_PACKAGE_TYPE_WEB", "2.2", "http://tizen.org/privilege/application.launch", &displayName);
    3. Get the privilege description using the privilege_info_get_description() function. The parameters are the API version, privilege name, and privilege description.
      char* description = NULL;
      int retVal = privilege_info_get_description("2.2", "http://tizen.org/privilege/application.launch", &description);
    4. Get the privilege description by package type using the privilege_info_get_description_by_pkgtype() function. The parameters are the package type, API version, privilege name, and privilege description.
      char* description = NULL;
      int retVal = privilege_info_get_description_by_pkgtype("PRVINFO_PACKAGE_TYPE_WEB", "2.2", "http://tizen.org/privilege/application.launch", &description);

    All functions above return the defined privilege_info_error_e enum value (in mobile and wearable applications) that indicates the result of executing the function and provides the privilege description by assigning the matching value to the third parameter.

Go to top