@Ein-Tim Since installation. Updates should not reset the count.
@dsarkar
Thanks!
So even when I update from version 1.14.4 (which doesn't show how long the app was installed) to version 1.15, the correct days will be shown?
@Ein-Tim very good question! 👍
I guess the answer depends on how they designed their solution.
And asking this question before the release of such a feature gives the devs the chance to design it from the beginning in a way that meets user expectations; instead of getting many questions and confused users after a release.
@ndegendogo
Yes, I wanted to ask this before the release.
If the app will show 0 days since installation after update to 1.15 then this needs a in app explanation (Pop-Up, etc.).
@Ein-Tim
From the code in the PR you can see that the installation date is inferred from the creation time of the app's folders. Upgrading the app does not affect this parameter.
enum InstallationDate {
static func inferredFromDocumentDirectoryCreationDate() -> Date {
guard
let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last,
let attributes = try? FileManager.default.attributesOfItem(atPath: documentsURL.path)
else {
return Date()
}
return attributes[.creationDate] as? Date ?? Date()
}
}
For Android, there is an API call that returns the first install date. Here the OS keeps track of the installation time.
Corona-Warn-App Open Source Team
Thanks @heinezen!
Most helpful comment
@Ein-Tim
From the code in the PR you can see that the installation date is inferred from the creation time of the app's folders. Upgrading the app does not affect this parameter.
For Android, there is an API call that returns the first install date. Here the OS keeps track of the installation time.
Corona-Warn-App Open Source Team