Announcements

Add a can_play_track field in user object (private)

Reply
Highlighted

Add a can_play_track field in user object (private)

Casual Listener

Hi,

 

I'm trying out to figure out whether a user has the permission to play a track, before attempting to send a call to the player endpoint.

 

The field "product" is useless in its current state, as there is no documentations about all the product types that can be returned, and what are the specificity of the product types in general.

 

Here is its vague description: The user’s Spotify subscription level: “premium”, “free”, etc. (The subscription level “open” can be considered the same as “free”.).

 

I personally remember seeing a subscription level for the free trial, where I had access to the player endpoint.

 

Proposed solution:

  • Either documenting the subscription level, giving an exhaustive list of the different subscriptions.
  • Adding a new field that let the user know if playback is allowed for that user.

Current alternative:

  • Waiting for the user to play a track within the app to let him know that "by the way, this app won't work for you as you are not premium". Which isn't recommended.
  • Comparing the string to "premium", and risking out not supporting people with valid subscription I've never heard of.
  • Attempting to issue a random play when the app starts up, and seeing if the response is forbidden with PREMIUM_REQUIRED, but this extra "play" can lead to a terrible user experience IMO.

Thank you

SUGGESTED POSTS