Tizen package manager APIs. Used to get information about packages installed on a Tizen device.
To use this package, add tizen_package_manager
as a dependency in your pubspec.yaml
file.
dependencies:
tizen_package_manager: ^0.2.1
To retrieve information of a specific package, use PackageManager.getPackageInfo
which returns an instance of PackageInfo
.
String packageId = 'org.tizen.settings';
PackageInfo package = await PackageManager.getPackageInfo(packageId);
To retrieve information of all packages installed on a Tizen device, use PackageManager.getPackagesInfo
.
List<PackageInfo> packages = await PackageManager.getPackagesInfo();
You can listen for package events using onInstallProgressChanged
, onUninstallProgressChanged
, and onUpdateProgressChanged
.
_subscription = PackageManager.onInstallProgressChanged.listen((event) {
// A package is being installed.
});
...
_subscription.cancel();
Privileges are required to use the package manager functionality. Add required privileges in tizen-manifest.xml
of your application.
<privileges>
<privilege>http://tizen.org/privilege/packagemanager.info</privilege>
<!-- The below is optional and only required for installation and uninstallation of packages. -->
<privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
</privileges>
Note that http://tizen.org/privilege/packagemanager.admin
is a platform-level privilege and can only be used by preloaded applications.