Get Application Installed Date With Flutter

Viewed 367

Is there's a way to find out the "Date when an application was installed" on Android & iOS with Flutter

2 Answers

use this plugin :

https://pub.dev/packages/device_apps

in Application class installTimeMillis is Installed date of app

List<Application> apps = await DeviceApps.getInstalledApplications();

apps.forEach((app) {
  DateTime installDate = 
    DateTime.fromMillisecondsSinceEpoch(
      app.installTimeMillis
    );
  print(installDate);
});

There is this package which works on Android and iOS: app_install_date

On Android it is using the PackageManager to get install date from the package info

On iOS and MacOS platforms it is using application document directory's creation date. This method is also used in native development

Here is an example on how to use it:

DateTime installDate;
// Platform messages may fail, so we use a try/catch 
try {
    installDate = await AppInstallDate().installDate;
} catch (e) {
    //handle error here
}

More info here

Related