By integrating the Cordova Plugin to the Fire TV Catalog, users can make voice and global text searches in the app and results will show in the Fire TV. This is an HTML5 app capability and through Apache Cordova (over which this plugin is based), it can be integrated to the Fire TV Catalog. Read on and learn how to perform this integration step by step.
Prerequisites
If you have never added to your Web App a Cordova project, you will need to create one.
1. Install npm and the Cordova command-line tool
2. Add Cordova to your web app project
With a line like this cordova create hello com.example.hello HelloWorld you would be giving the name “hello” to your project. Among other files, the newly-created “hello” directory inside your web app will include a file named “config.xml” and it contains a list of the available intents your app can handle.
3. Add the Android platform
Adding the Android platform is a must for your Cordova project. You can do it with the cordova platform add android line.
1. Clone the Cordova plugin
For the integration with the Fire TV Launcher from GitHub. We recommend you put the folder in a convenient location.
2) Install the Cordova Plugin
Using the following command and customizing its parameters you can install the Cordova Plugin for Fire TV Catalog Integration.
To check if the plugin was correctly added to your Cordova Project, check on: <CORDOVA_PROJECT>/platforms/android/src/com/amazon
4. Editing web app to accept launch parameter
Functionality implementation in your web app is a must for it to handle the query parameter upon reception. When the app receives the parameter: amazonLauncherIntegrationContentId, it should directly route the contentId into the player. Playback should be immediate with no customer interaction required.
Once the plugin addition is successful, you are ready to start building your app. You can do it with the following command:
Sideload the app to a Fire TV and test the app in it. You can do this using adb, for example: adb install /<path-to-apk>/android-debug.apk
Prerequisites
If you have never added to your Web App a Cordova project, you will need to create one.
1. Install npm and the Cordova command-line tool
2. Add Cordova to your web app project
With a line like this cordova create hello com.example.hello HelloWorld you would be giving the name “hello” to your project. Among other files, the newly-created “hello” directory inside your web app will include a file named “config.xml” and it contains a list of the available intents your app can handle.
3. Add the Android platform
Adding the Android platform is a must for your Cordova project. You can do it with the cordova platform add android line.
- ■ If an error message appears saying “Error: Current working directory is not a Cordova-based project.” then double check the directory you´re installing it at, because it might be the wrong one.
- ■ If you want the plugin to be available in your computer globally, then you will need to install Plugman, which is a package manager for Node. You can do it with the following line: npm install -g plugman.
1. Clone the Cordova plugin
For the integration with the Fire TV Launcher from GitHub. We recommend you put the folder in a convenient location.
2) Install the Cordova Plugin
Using the following command and customizing its parameters you can install the Cordova Plugin for Fire TV Catalog Integration.
- ■ Parameters not configured:
- ■ Configured parameters:
- ■ Without the Plugman plugin:
- ■ If the installation is successful you´ll get this message:
To check if the plugin was correctly added to your Cordova Project, check on: <CORDOVA_PROJECT>/platforms/android/src/com/amazon
4. Editing web app to accept launch parameter
Functionality implementation in your web app is a must for it to handle the query parameter upon reception. When the app receives the parameter: amazonLauncherIntegrationContentId, it should directly route the contentId into the player. Playback should be immediate with no customer interaction required.
- ■Error handling implementation
An error message and a redirection to a suitable location it is the best customer experience if the uploaded catalog and the available content are out of sync. It is important not to overlook this and implement it in the app to have a successful experience with it.
Once the plugin addition is successful, you are ready to start building your app. You can do it with the following command:
- ■ If the building of the app is successful, Cordova will generate an APK file.
Sideload the app to a Fire TV and test the app in it. You can do this using adb, for example: adb install /<path-to-apk>/android-debug.apk
- ■ After sideloading test the functionality with the button on your remote for the microphone. Engage it and try searching for media with it. Search results should show matched media coming from your app. With a click on an image title, you should be able to ignite your app and the content should start playing.