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: 
ttruecaller
Visitor

serial number of the device

hi,

what function i need to call to get serial number if the device .

thanks
0 Kudos
6 REPLIES 6
destruk
Streaming Star

Re: serial number of the device

di=createobject("roDeviceInfo")
identifier=di.GetChannelClientId()


GetDeviceUniqueId() as String
Returns the serial number of the unit running the script. This is a 12 character alphanumeric string. While this value was traditionally used to uniquely identify a device, we now recommend using the publisher ID for this purpose.

GetDeviceUniqueID() is deprecated and will be removed from the firmware in the Spring 2019 OS update. Developers must update their channels to use the 12-character alphanumeric unique identifier returned by GetChannelClientId()

https://sdkdocs.roku.com/display/sdkdoc/ifDeviceInfo
0 Kudos
ttruecaller
Visitor

Re: serial number of the device

i am getting 8-4-4-4-12 digit code while using the following function

di=createobject("roDeviceInfo")

identifier=di.GetChannelClientId()
0 Kudos
destruk
Streaming Star

Re: serial number of the device

Roku has changed this system multiple times, so that isn't surprising they wouldn't update the documentation.  You can understand the reasoning as to why they don't want you to rely on a static permanent unchanging reference to an individual roku box that survives a factory default and transfer of the unit to another person that might install your channel app and allow them use of that previous owner's credit card or roku account in some fashion.  Using the serial number or other unchanging data should not be an imperative feature of your channel code, but what they currently supply is this if you absolutely must have some functionality and wish the channel to be publicly certified no matter what it returns.
0 Kudos
ttruecaller
Visitor

Re: serial number of the device

We were using the publisher ID in place of GetDeviceUniqueId() to get the serial number of the unit running the script which is a 12 character alphanumeric string. For publisher ID also we were getting 8-4-4-4-12 result only & also warning us this will be deprecated. Please help us in resolving this.
0 Kudos
speechles
Roku Guru

Re: serial number of the device

di=createobject("roDeviceInfo")
uniqueid = di.GetChannelClientId()
friendlyname = di.GetFriendlyName()

along with..

if NOT di.isRIDADisabled()
    rida = di.GetRida()
else
   rida = "<UNAVAILABLE>"
end if

Use some variety of the uniqueid their friendlyname and the rida if it is available. Then you comply with EU terms/law in those regions. Those other identifiers are deprecated for a reason. You must stop using them. 
0 Kudos
AshikaAP
Newbie

Re: serial number of the device

Hi,

Did you find a function to identify device serial number which is of the format: 

1GU48T017973

 

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.