See if user is logged in

80 views
Skip to first unread message

John Wang

unread,
Nov 10, 2011, 5:28:19 AM11/10/11
to Rdio API
I'm creating an app that streams via the Web Playback API.

If a user is not logged in, then the API will only stream previews.

Is there a way to detect if a user is logged in?

Andy Soell

unread,
Nov 10, 2011, 9:00:23 AM11/10/11
to rdio...@googlegroups.com
If you make a request that should return user data (such as the 'get' method) and additionally request the 'isTrial,' 'isSubscriber,' or 'isUnlimited' extras, you should get back a 0 or 1 to indicate which plan the selected user is subscribed to. They recently also added the 'inFreeLimited' field to indicate that the user still has free tracks remaining, and 'freeLimitedRemaining' to get the percentage of free tracks they still have available.

Hope that helps!

andy

> --
> You received this message because you are subscribed to the Google Groups "Rdio API" group.
> To post to this group, send email to rdio...@googlegroups.com.
> To unsubscribe from this group, send email to rdio-api+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rdio-api?hl=en.
>

Ian McKellar

unread,
Nov 12, 2011, 6:52:22 PM11/12/11
to rdio...@googlegroups.com
Hi John,

Like Andy said right now the way to determine the user's state it to do an oauth authentication for them. I'm interested in making some of that information available through the Flash API but there are some potential privacy implications that I want to think through fully before exposing it.

Ian
--
Ian McKellar
Rdio Inc.
http://rd.io/people/ian

Blair Duncan

unread,
Nov 12, 2011, 7:52:25 PM11/12/11
to rdio...@googlegroups.com
It seems the rdio webPlayer does make use of cookies to reduce the amount of times that a user needs to actually log in to simply play music.

I for example have very rarely logged-in after initial authentication.  I've never figured it out (I think it only happens if I restart my laptop) but it is not uncommon for me to go several weeks between authentications...In the mean time I find that I can search and play full length music.  Actually in reality the only time I ever need to be authenticated/logged in is when I want to create/modify playlists. 

Ian McKellar

unread,
Nov 17, 2011, 7:27:01 PM11/17/11
to rdio...@googlegroups.com
Good news, developers,

I've gotten this working. As of right now the API SWF will expose information about the subscription state of the user. For privacy reasons user identifiable info (username, key, real name, etc) isn't available. The ready() callback now gets a single argument which is null if the user isn't signed into Rdio, or if it is an Rdio user, an object containing the following keys:
 - isTrial - boolean, is the user in a trial
 - isSubscriber - boolean, is the user a subscriber
 - isUnlimited - boolean, does the user have rights to stream on mobile devices
 - inFreeLimited - boolean, is the user an Rdio free user
 - freeLimitedRemaining - integer, the percentage of free plays remaining for a user - ignore if inFreeLimited is false

There's also another callback called freeLimitedRemainingChanged that gets a single argument that is the new value for freeLimitedRemaining.

I haven't updated the documentation yet but I have updated the simplest example: https://github.com/rdio/hello-web-playback

The documentation isn't updated because these values don't take into account any user associated with the playbackToken. I'm planning to change the way that the playbackToken is used by the web playback API. I've noticed that the process of getting a playbackToken is confusing and if often the slowest part of getting your web app actually playing music. Expect changes to that effect to come in the next month or so.

In the meantime, have a play with this new interface for getting information about a user. Hopefully it'll make it much easier to predict if a user will be getting previews rather than full tracks and to present up-sell.

Ian
Reply all
Reply to author
Forward
0 new messages