"joetesta" wrote:
yes in the example applications that come with the SDK, look for the one called 'register' and merge it into your channel.
"Biju" wrote:"joetesta" wrote:
yes in the example applications that come with the SDK, look for the one called 'register' and merge it into your channel.
How to merge it into my channel im? do you have the sample code for it?
end sub
xfer=createobject("rourltransfer")
xfer.seturl("http://mywebserver.com/serialnumbers.txt") 'the url and path to your file
list=xfer.gettostring().tokenize(chr(10))
di=createobject("rodeviceinfo")
myserial=di.getdeviceuniqueID()
?myserial
linked=false
for each number in list
if number.left(number.instr(chr(13)))=myserial or number=myserial then
linked=true
end if
end for
if linked=false then
dialog=createobject("roonelinedialog")
dialog.settitle("Serial number: "+myserial)
?"my SN=";myserial
dialog.show()
sleep(20000)
dialog.close()
return
end if
"RokuJoel" wrote:
Biju, here is a little thing I whipped up this morning which might solve your short-term private channel linking issue. I haven't tested it, but it should work:
On your website, you create a text file of all the serial numbers, each on its own line.
on the roku, In the very top of your channel, in sub main(), put in the following:
sub main()end sub
xfer=createobject("rourltransfer")
xfer.seturl("http://mywebserver.com/serialnumbers.txt") 'the url and path to your file
list=xfer.gettostring().tokenize(chr(10))
di=createobject("rodeviceinfo")
myserial=di.getdeviceuniqueID()
?myserial
linked=false
for each number in list
if number.left(number.instr(chr(13)))=myserial or number=myserial then
linked=true
end if
end for
if linked=false then
dialog=createobject("roonelinedialog")
dialog.settitle("Serial number: "+myserial)
?"my SN=";myserial
dialog.show()
sleep(20000)
dialog.close()
return
end if
Note that this has only been tested with a text file created by windows Notepad.
So essentially, if someone launches the app and their serial is not in your text file, it will display their serial number for 20 seconds and exit, otherwise, it should continue on to allow them access to your content.
"RokuJoel" wrote:
Depends on which sample application you based your project on. If it is the videoplayer example then it would go in appMain.brs, right at the top, immediately after Sub Main()
You have to have the serialnumbers.txt file on your server before you launch the project. It doesn't have to have any content yet, but it needs to be there.
- Joel