Forum Discussion
Biju
14 years agoVisitor
"RokuJoel" wrote:
To get the code from the server, you would do something like:xfer=createobject("roURLtransfer")
xfer.seturl("http://myserver.com/makepin.php")
screen=createobject("roCodeRegistrationScreen")
screen.addfocaltext("please visit http://myserver.com/roku to link your device")
screen.setregistrationcode(xfer.gettostring())
screen.show()
You would use checkcode.php to check if the user had entered the code. If the have then you return from your registration function with a number representing success or failure of registration, so if it returns 0 you exit your channel (because the user canceled registration), if it returns 1 you continue and display the content.
So the opening of your program might look like:
sub main()
screen=createobject("roposterscreen")
screen.show()
if register() =0 then return
screen.setcontentlist(getmyauthorizedcontent())
...
the reason for loading the Posterscreen first is to prevent the channel from exiting after successful registration.
thanks a lot for your quick response. In which file do i have to put these codes, currently im using sample videoplyer sdk.