music.listen returns an empty array

2019-04-14 17:08发布

问题:

I'm working on a Spotify in-app application.

I like to know what my friends are listening. I'm currently using music.listen open graph api, but it returns an empty data for most of users.

I signed up a new facebook account then signed in Spotify using the new account. I clikced a song then logged out.

I then switched back my original account then I get data for the new facebook account (which is friend of my original account)

so my guess is that music.listen works for only new users (or recently signed up)?

Is this true?

Updated:

Here's what worked for me

  1. I signed up a new facebook account on my second computer
  2. Installed Spotify app then signed in with the new facebook account.
  3. Spotify prompted a message and I clicked continue
  4. I clicked a song and shared it to facebook.

  5. on my main computer, I signed into Spotify with a different facebook (friend of the new facebook account) then accessed my app. My app gets a list of songs that my new facebook account listened.

While using my new facebook, I didn't see a permission box.

So my question is...how come a new facebook works, but not existing accounts?

回答1:

Do you definitely have the correct permissions? you'll need the user_actions.music or friends_actions.music permissions to read a user's list of music activity

For more information see https://developers.facebook.com/docs/authentication/permissions/ and https://developers.facebook.com/docs/authentication/

see https://developers.facebook.com/docs/authentication/permissions/#open_graph_perms specifically for music

It will then be accessible at /USER_ID/music.listens

Are you also sure that the users you're checking for actually use one of the social music apps and their activity in that app is visible to you?