This worked for me (Xcode 13), thanks!
Post
Replies
Boosts
Views
Activity
With Xcode 13 the access is there, and I still see those two error messages occasionally, and the thing is they do not seem to be linked to any type of album. I have the following three lines going one after another:
userCollections = PHCollectionList.fetchTopLevelUserCollections(with: nil)
allPhotos = PHAsset.fetchAssets(with: allPhotosOptions)
smartAlbums = PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .albumRegular, options: nil)
I've played with the order they are placed in the code, and I always have the "Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)" message after the first command whatever it is out of the three; and I always get the "[PAAccessLogger] Failed to log access with error: access=<PATCCAccess 0x280b27e10> accessor" message after the second command, whatever it is. The third command runs clean:
2021-10-10 12:01:25.438540+0100 TD in SwiftUI[2306:680717] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)""
2021-10-10 12:01:28.869695+0100 TD in SwiftUI[2306:680930] [PAAccessLogger] Failed to log access with error: access=<PATCCAccess 0x282ee56e0> accessor:<<PAApplication 0x2820ec6e0> identifierType:auditToken identifier:{pid:2306, version:5997}> identifier:xxxxxxxxxxxxx kind:intervalEnd timestampAdjustment:0 tccService:kTCCServicePhotos, error=Error Domain=PAErrorDomain Code=11 "Possibly incomplete access interval automatically ended by daemon"
(lldb)
So, the functionality seems to be there, but the error messages are thrown still but not consistently.
Also, I can only see the messages when building for a physical device (8+) but not in the Simulator for the same model,