From iOS 16, PhotoKit does not return PHAsset of "Recently Deleted" PHAssetCollection ?

I can get some PHAsset from "Recently Deleted" PHAssetCollection(1000000201) using PHAsset.fetchAssets on iOS 15.7.1.

However, for iOS 16 and above, the method return PHFetchResult of zero PHAsset.

I think that the problem has relation of a change that "Recently Deleted" is locked folder from iOS 16...

Is there a way to get PHAsset from "Recently Deleted" PHAssetCollection?

I'm thinking of giving up if there is no way.

Thank you, Tattin

You're right that Recently Deleted is now a locked folder/album, and you can infer from the fact that you do or do not get anything back whether it's locked. There may be some property somewhere but a quick look hasn't yielded anything.

So I'd just handle if you get something back (album is not locked) or don't get something back (album is locked).

Dear darkpaw

Thank you for your response!!

Yes, I think so.
I tried using the "includeHiddenAssets" parameter when call "PHAsset.fetchAssets" method.
But there was no PHAsset.

I want to know the way to use "PHAsset.fetchAssets" how my app can get PHAsset of Recently Deleted if there is a way...

Thank you!!

There is no API by which your app can fetch Recently Deleted assets.

As for the question about "includeHideenAssets", there's a note on what the expectations should be starting in iOS 16.

https://developer.apple.com/documentation/photokit/phasset/1624773-hidden?language=objc

Hidden assets are only available in the hidden Smart Album or in user Smart Albums. To include these assets, use the includeHiddenAssets fetch option. Beginning with iOS 16, users can require authentication to view the hidden album, and the user setting is YES by default. When YES, the system doesn’t return hidden assets even if the includeHiddenAssets fetch option is YES. If you use PhotosPicker, a user can choose hidden assets to provide to your app.

Dear Apple's Frameworks Engineer

Thank you for your response!!

I already looked at that document before I posted this question.

users can require authentication to view the hidden album, and the user setting is YES by default. When YES, the system doesn’t return hidden assets even if the includeHiddenAssets fetch option is YES

And I already checked this message as well.

iOS 16 Beta: Access "Hidden smart album" from PhotoKit - https://developer.apple.com/forums/thread/709822?answerId=719587022#719587022

I want to know if there is a way that we can ask the authentication to our users like "Privacy - Photo Library Usage Description" authentication.

I want to know the way If it is possible that we can get hidden assets by using "PHAsset.fetchAssets".
Because my app is providing an own ui to select the photos and videos.

At the moment, is the PhotosPicker an only way to get hidden assets?

Thank you!!

From iOS 16, PhotoKit does not return PHAsset of "Recently Deleted" PHAssetCollection ?
 
 
Q