Forum Discussion
RokuJoel
14 years agoBinge Watcher
To get the code from the server, you would do something like:
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:
the reason for loading the Posterscreen first is to prevent the channel from exiting after successful registration.
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.