In order to have an app approved for Amazon Fire TV, the media buttons on the remote must remain open to control media applications running in the background (Pandora…etc). Unfortunately, it seems that it is currently not possible to allow a Unity game to pass those buttons through to the media applications.
I asked the Amazon team how I could resolve this issue and received this reply:
Since you are using Unity3d, the issue of controlling the media buttons is something that you cannot fix yourself. It would need to be resolved by Unity in a future release and/or fix to the engine to allow for those buttons to be interpreted correctly.
Anyone have a workaround or know where I can submit this fix request to Unity? I modified 3 of my games to work with both Fire TV controllers before receiving the reply from Amazon that the app wouldn’t be approved for their store until Unity fixed this issue.
CastielRising: We also got reprimanded because the music on the title screen does not shut off when the device goes into “dream state.” In the Player settings, I have “run in background” deselected, but that doesn’t stop the music. (Actually, I’m not sure what “dream state” is – is that the slideshow of beautiful landscapes, or does the device go to sleep at some point?) Did you have a method for that?
I just played Dead Trigger 2. That is also made with Unity. It also is non responsive to media player buttons. Amazon should not be playing favorites and denying smaller developers for issues that larger companies are getting away with.
Test: Press the Fast Forward, Play/Pause, and Rewind buttons.
Expected Results: In media playback, the media buttons behave as expected. In non-media apps, the media buttons should not be used for some other function, as this may interfere with the system’s ability to control media playing in the background. Note that If your app uses a framework such as Unity, you may ignore this requirement , as the ability to pass key events through to the system is not supported in those frameworks.
I just saw that posted on the amazon developer forum. Thank you for posting it here.
I was wondering about Dead Trigger, because I tried it as well and couldn’t get the media buttons to work. Agreed with your point about them playing favorites.
Regarding the other issue, with audio not muted when FireTV switches to the screensaver, Amazon replied to my question on their forum:
Fire TV is essentially an Android API level 17 device (4.2).
The screensaver will call onWindowFocusChanged(boolean) on the point in which it is turned on. You can implement that callback in their activity to be able to pause your app gracefully when this happens. Thanks.
But that requires access to Android/Java calls, doesn’t it? Is there an easy way to listen for those in Unity?
Have any of you had an issue with IAP? The remote input is not being reset when the IAP launches the IAP SDK Tester. Since this is just a tester, its very possible that it may work fine in the real thing. And Amazon has admitted themselves that there are issues with the Tester, especially that controllers don’t work. But during my tests about 20-30% of the time it does not reset the controller input. That’s just too often for me to want to risk it happening when people are spending real money.
Since the button getting stuck is the select button (joystickbutton0) when the player returns to the menu he starts accidentally purchasing items with the in-game currency.
I attempted to fix this by using Input.ResetInputAxes(). However that seems to be doing nothing. Just to be sure I stuck it in a loop that fires it off about 10 times before and after making the purchase. I can see in the debug output that it is firing off. But still the input gets stuck until you press the button again.