'How can I store data/string in Roku TV app?

I want to implement token based login, So I need to store Auth token to verify the login session.

Please provide any solution. TIA



Solution 1:[1]

This is a sample for set and get userToken:

Function GetAuthData() As Dynamic
 sec = CreateObject("roRegistrySection", "Authentication")
 if sec.Exists("UserRegistrationToken")
     return sec.Read("UserRegistrationToken")
 endif
 return invalid
End Function

Function SetAuthData(userToken As String) As Void
  sec = CreateObject("roRegistrySection", "Authentication")
  sec.Write("UserRegistrationToken", userToken)
  sec.Flush()
End Function

Solution 2:[2]

It looks like you have a byte string init_msg that you want to turn into a unicode string. You probably wanted to use decode instead of encode:

rospy.loginfo( init_msg.decode('utf-8')[0:(len(init_msg)-1)] )

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Amir Kaftari
Solution 2 day