Search code examples
geolocationrokubrightscript

How to get Roku's device geolocation?


I need to deliver content with geolocation restrictions, so I need to know exactly what's the physical location of device.

Accordingly to Documentation there is two methods GetCurrentLocale() and GetCountryCode(), however documentation relays on none of this methods can actually be used to get physical location..

GetCurrentLocale - Returns a string representing the current locale based on the user's language setting ...

GetCountryCode - This does not necessarily match the physical location of the device ...

So my question here is if it's safe to use any of these methods in order to apply geolocation restrictions?


Solution

  • No, you cannot know "exactly what's the physical location" of a Roku. It has no GPS, nor does it do location approximation based on WiFi SSIDs (that would be a privacy no-no).

    The APIs you found return codes based on the player setup and are not reliable, since i can reset my player and change the country during new setup. What video services do instead is do geolocation by IP address, there are multiple external services that will help.