Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
RokuChris
Roku Employee
Roku Employee

Re: got register example working but...

"FML2010" wrote:
got another question...

how can i get the "get new code" to send the request back to the website for a new one?

i have had no luck with any Buttons doing anything i want them to do!!


Button events are identified using the isButtonPressed() method on the event object. The code that handles the "get new code" button in the registration example is on line 75 of regScreen.brs. It changes the text on the registration screen to read "retrieving code..." and sets a flag getNewCode that causes the channel to break out of the "polling loop" and fall out to the main registration loop which starts the whole process over by fetching a new code.
0 Kudos
FML2010
Visitor

Re: got register example working but...

Thanks Chris already doing a great job as admin!!
0 Kudos
FML2010
Visitor

Re: got register example working but... <SOLVED (NotYet)...

so here is what i did and not sure if is correct, can you check to see if this is correct and would this write to the registry?

        
elseif e.GetName() = "customerId" then
customerId = strtoi(e.GetBody())
RegWrite("customerId", customerId)
elseif e.GetName() = "type" then
userType = strtoi(e.GetBody())
RegWrite("userType", userType)
elseif e.GetName() = "creationTime" then
creationTime = strtoi(e.GetBody())

0 Kudos
RokuKevin
Visitor

Re: got register example working but... <SOLVED>

I'm assuming you got RegWrite() from our utils.brs which does the Flush().... Then yes, you are saving customerId and type to the registry. In the code snippet you shared, you aren't saving creationTime to the registry.

--Kevin
0 Kudos
FML2010
Visitor

Re: got register example working but... <SOLVED>

Kevin is that necessary you think?

I will add it just in case, i have it saved in my Database, but it may come in handy for something else, thanks for pointing that out.

Is it possible to extend the time before the second fetch is done? it goes so fast that it just flashes the screen... its odd
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.