6

I need to access to user's iTunes library. I want to list all songs besides playlists and albums that a user has purchased from iTunes Store or add to his library from Apple Music or synchronized and loaded from its computer. I use MPMediaQuery to retrieve the list. Everything looks working fine except that I am getting an error when I run the code below:

2019-12-10 12:55:01.098885+0300 AppName[11292:2511243] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
2019-12-10 12:55:01.101918+0300 AppName[11292:2511243] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
2019-12-10 12:55:01.124897+0300 AppName[11292:2511243] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
2019-12-10 12:55:01.125093+0300 AppName[11292:2511243] [iTunesCloud] [ICUserIdentityStore] Failed to fetch local store account with error: Error Domain=com.apple.accounts Code=9 "(null)".

Code works fine and lists everything that I have on my library including items that I have purchased from iTunes Store. I am trying hard to understand why it prints an error even it is working.

let myPlaylistQuery = MPMediaQuery.playlists()
        let playlists = myPlaylistQuery.collections
        for playlist in playlists! {
            print(playlist.value(forProperty: MPMediaPlaylistPropertyName)!)

            let songs = playlist.items
            for song in songs {
                let songTitle = song.value(forProperty: MPMediaItemPropertyTitle)
                print("\t\t", songTitle!)
            }
        }
amone
  • 3,712
  • 10
  • 36
  • 53
  • What happens when you set `OS_ACTIVIITY_MODE` to `disable`? –  Dec 10 '19 at 10:57
  • @dfd Error is still there. What is the reason that I am getting it? – amone Dec 10 '19 at 12:08
  • 1
    I don't know. I was trying to help rule out a lot of things. I get this error: `Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)"` while using Apple's own sample code for "Photo Browse OS". It was *very* similar to yours' - everything works but still getting *something* stating an error. In my case? I have to restart the app because of how - I think - Apple coded caching of images. –  Dec 10 '19 at 15:38

0 Answers0