Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
ttruecaller
Level 7

serial number of the device

hi,

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

thanks
0 Kudos
5 Replies
destruk
Level 10

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
Level 7

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
Level 10

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
Level 7

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
Level 7

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