Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can be detected when an app has been restored from a backup?

ALAssetPropertyAssetURL property is a handy way to store a reference to an ALAsset but during system restore (or upgrade) some assets might change this property. While there might be some workarounds to update the assets reference url, how do I detect when this is needed? System updgrade is easy, but how do I detect when an app has been restored from a backup, also if this happened in the same device?

like image 450
Nuthinking Avatar asked Oct 19 '25 10:10

Nuthinking


1 Answers

When your app launches, look in the documents for a file of a known name (DidLaunch.txt, say), and if its not there, create it, and set its metadata "Do Not Backup". On every launch, look for that file - if its there, you previously launched on this device. If its not there, this is a fresh launch.

like image 147
David H Avatar answered Oct 22 '25 03:10

David H



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!