Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dynamitemedia
Level 8

user star ratings question

i have went thru all the examples and the component reference in the 2.7 sdk as well as searched the forum here. and see no example of this.

i have added the user ratings but when i click on it i am not getting info back on the console, i did a print and i can get when i click on it and the index number.

what am i missing ? does any one have a snipplet of what they are using on this? the back end is already waiting but cant seem to get any info from this button at present
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
2 REPLIES 2\
TheEndless
Level 9

Re: user star ratings question

The star rating is returned in msg.GetData() of the isButtonPressed() event.

The documentation states the following:
Boolean AddRatingButton(Integer id, String userRating,
String aggregateRating)

  • Adds a star rating button to the screen. The rating is specified as a string whose value is
    an integer 1-100 which indicates the number of stars (1 to 5) to be displayed. Think of
    this as a percentage value <20% = 1 star. This button is displayed in the menu area of
    the screen and appears in the order added. The userRating specifies the value the user
    rated the title, while the aggregate Rating represents the total for all users. The
    userRating takes precedence and determines the color of the buttons if set. The
    aggregateRating may display half-stars. The button returns the userRating in the event
    data field.

and

isButtonPressed()
  • Event indicating a button on the screen was selected and the ID of the button
    that was selected.

  • Event Details: Type = 5, Msg = “”, Index = ID of button from AddButton(), Data =
    0 –or- value of user selection if the button type is a rating button.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
dynamitemedia
Level 8

Re: user star ratings question

thanks and for anyone inetersted the code is:

if msg.getIndex() =   2    ' or whichever button you have it as

userRating = msg.GetData()
print "the user rating is : "; userRating

' save to DB here

end if


when i searched "userRating" i found the first part you showed, but it never showed up elsewhere with that term, i should have searched "Rating"

Can't believe i didnt think of msg.GetData()

well now its in the forum in case it snags someone else Smiley Wink , thanks Endless
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos