Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do iOS Data Protection delegates getting called multiple times?

While working on iOS, Objective C, I found the delegate of UIApplicationDelegate,

applicationProtectedDataDidBecomeAvailable

is getting called multiple times after device unlocked. What could be the possible reasons?


applicationProtectedDataDidBecomeAvailable - On a device that uses content protection, protected files are stored in an encrypted form and made available only at certain times, usually when the device is unlocked. This notification lets your app know that the device is now unlocked and that you may access certain types of protected files again.

like image 298
Sazzad Hissain Khan Avatar asked Oct 15 '22 08:10

Sazzad Hissain Khan


1 Answers

It is a known and normal function of the call.

According to the documentation on 'applicationProtectedDataDidBecomeAvailable' is called continually in order to tell the delegate that protected files are available now. so on lock certain files are not available.

On a device that uses content protection, protected files are stored in an encrypted form and made available only at certain times, usually when the device is unlocked. This notification lets your app know that the device is now unlocked and that you may access certain types of protected files again.

Reference: https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623044-applicationprotecteddatadidbecom

I hope this helped. let me know.

like image 77
mw509 Avatar answered Oct 27 '22 00:10

mw509