question

ek-os avatar image
ek-os asked

Adding restrictions to Fire TV Web app based on user's country

We recently successfully submitted a US-only version of our app based on the Fire TV web app starter kit (which was really great, by the way; we able very quickly to modify it to work with our content). We would now like to make a restricted version of the app available outside the US. Basically, non-US users should not have access to two of our live video streams. Can you point me to documentation that would help us to build restrictions into the app based on the user's country? For example, does the device make any settings available that would allow the web app to determine the user's country and choose the right content based on that? We could make the app do a geolocation query before getting the content, but that would increase the app's initial load time, which we'd like to avoid if possible. We would also like to avoid having different apps for the US and the rest of the world if possible, as the only thing that would be different would be the URL for retrieving the content, and everything else would be identical. Thanks for any help you can give us.
fire tv
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nick Gardner avatar image
Nick Gardner answered
Hi, You should be able to use the navigator.geolocation properly, which we have documentation on here: https://developer.amazon.com/public/solutions/platforms/webapps/docs/using-geolocation-data Thanks, Nick
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ek-os avatar image
ek-os answered
Hi Nick, The geolocation documentation you provided is for mobile devices with GPS hardware. Does the Fire TV support it? Also, as far as I can tell, the API returns position information (latitude and longitude), but no country code. So to use this information we'd have to figure out the range of longitudes and latitudes for the U.S. and its territories to see if the user is within the right geographical areas. Is there no simpler way to tell in which country the user registered his Fire TV box/stick? Thanks.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ek-os avatar image
ek-os answered
I am testing accessing the geolocation data on the Fire TV, but when I run the app in the web app tester and the app tries to call the navigator.geolocation.getCurrentPosition() function, the app crashes. I really don't need or want to know exactly where the device is, just what country the device is assigned to. Somehow the device knows which country the user's account is associated with, without having to use location-based services. Isn't there any way for an app to know in which country the device is registered?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nick Gardner avatar image
Nick Gardner answered
Hi, I don't believe there's any user facing API to get that information directly other than using geolocation information. Thanks, Nick
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sinistar avatar image
Sinistar answered
Since the dingus doesn't have a GPS, the location apps aren't gonna work, but you can get the location from IP which is pretty accurate. Maxmind has free databases which are pretty close on a city level. Well good enough to tell you what country they're in anyway. https://www.maxmind.com/en/open-source-data-and-api-for-ip-geolocation Message was edited by: Sinistar
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.