Gracias por tu visita. Esta página solo está disponible en inglés.

Step 2: Verify Deep Links from the Catalog

Before submitting your app to the Amazon Appstore, validate your integration by running through the test cases listed here. Successfully validating the correct behavior will help facilitate your app's acceptance to the Appstore. Depending on the state (published or unpublished) and conditions of your app (login required or not, free trial or not), you will only need to perform the steps that apply to your app.

Initiate Comrade with adb to See Intents Sent

To see the intents your app sends, connect to your Fire TV device using adb and initiate Comrade. Comrade is the name of the Fire TV API that manages content with the launcher. Note that you must use a Fire TV device other than Fire TV Edition (the smart TVs with Fire TV built in) to see the intents sent during these tests.

To see the intents sent to the Fire TV launcher:

  1. First, uninstall your app.

    On Fire TV, to uninstall your app, go to Settings > Applications > Manage Installed Applications. Select your app, and then click Uninstall twice.

  2. Connect to Fire TV device via adb. For example:

    adb connect 10.49.172.33:5555
    

    For wireless connections, you can find your network address at Settings > My Fire TV > About > Network. (Some models say "Device" instead of "My Fire TV.")

    If your Fire TV device lets you connect via USB, you can also use a wired connection. See Connecting to Fire TV Through adb for more details.

  3. Install your app using adb.

    You can install your app from the terminal using adb with this command:

    adb install <path-to-apk-file>
    

    Or from Android Studio, click the Run 'app' button Run 'app' button and select your device. See Install and Run Your App for more details.

  4. Clear logcat.

    Using adb commands, you can clear logcat as follows:

    adb logcat -c
    
  5. Run the following command:

    adb logcat | grep FTVCS:ComradeActionHandler
    
  6. Leave the terminal open so you can monitor the Intents that are sent. Then initiate the actions shown in the next section, Action Initiated and Intents Sent and observe the responses. A later section, Sample Output from the adb Commands, shows sample output that you should see in your terminal.

Action Initiated and Intents Sent

This section shows the actions initiated and subsequent Intents that should be sent as a result.

Action Initiated Intents Sent
At first launch, such as any of the following:
  • app launch after install ...
  • app launch after device restart ...
  • app launch after force stop ...

... the Sign-in intent should be sent by default.

... the Playback intent should only be sent at this time if any of the following is true:

  • Viewing all content does not require sign-in (that is, all your content is free to watch without requiring an account, even if account creation is free)
  • Your app uses SSO, and there is a valid SSO token for your app
  • Your app uses its own type of automatic verification and validates the user has access

After successfully signing in … … the Playback intent should be sent
At sign out or log out … … the Sign-in intent should be sent
If your app uses single-sign-on (SSO) and your app is in the background … … when your app resumes and you determine there is a valid SSO token onResume, the Playback intent should be sent. (Note: To move your app to the background, launch your app, then press Home on your remote.)

Sample Output from the adb Commands

This section shows sample intent outputs that should appear in your terminal, with the key information highlighted. The highlighted values indicate which intent was received from your app:

  • SIGN_IN: Sign-in intent
  • PLAY: Playback intent
  • PARTNER123: Partner's catalog name

Sign-in Intent Output Samples

When receiving a Sign-in intent, you will see outputs such as the following:

06-11 16:09:57.448  4347 16145 I FTVCS:ComradeActionHandler: Received capability: SIGN_IN
for partner: PARTNER123 06-11 16:09:57.450  4347 16145 I FTVCS:ComradeActionHandler: Processing
capabilities Capabilities{mPartnerId='PARTNER123', mPackageName='com.yourpackagename.firetv',
mComradeApiVersion=V1, mSubscriptionIds=[],
mCapabilities={SIGN_IN=Capabilities{mCapabilityType=SIGN_IN,
mIntentPackageName='com.yourpackagename.firetv',
mIntentAction='android.intent.action.VIEW',
mIntentClassName='com.partner.android.IntegrationActivity',
mIntentDataExtraName='null', mIntentFlags=-1}}}

The above code uses generic values. You will see your app's own package name, classes, and extras.

Playback Intent Output Samples

When receiving a Playback intent, you will see outputs such as the following:

06-11 16:09:57.379  4347 16145 I FTVCS:ComradeActionHandler: Received capability: PLAY for
partner: PARTNER123 06-11 16:09:57.380  4347 16145 I FTVCS:ComradeActionHandler: Processing
capabilities Capabilities{mPartnerId='PARTNER123', mPackageName='com.yourpackagename.firetv',
mComradeApiVersion=V1, mSubscriptionIds=[],
mCapabilities={PLAY=Capabilities{mCapabilityType=PLAY,
mIntentPackageName='com.yourpackagename.firetv',
mIntentAction='com.yourpackagename.amazon.catalog.ON_MESSAGE',
mIntentClassName='com.yourpackagename.MainActivity', mIntentDataExtraName='null',
mIntentFlags=268435456}}}

The above code uses generic values. You will see your app's own package name, classes, and extras.

In addition to ensuring the right Intents are sent, you should also test the deep link behavior. More specifically, make sure that playback of content selected by a user opens the app and launches directly into video playback (if the app sent the Playback intent) or launches to the sign-in or sign-up screen within their app (if the app sent the Sign-in intent).

Two types of user states should be tested for each deep link scenario: un-authenticated and authenticated users. To test out the deep links, you search for media from your app using Fire TV's universal search, and then select to watch the result in your app. The following table shows the expected conditions and results.

Conditions Result
Un-authenticated state: Your app requires authentication to view content, but the user has not yet signed in The deep link should take you to the authentication/sign-up screen. After successful authentication, the video should start to play.
Authenticated state: Your app requires authentication to view content, and the user is signed in successfully. Alternatively, all the content is free to watch, even without account creation. The deep link should start playback of video (it should not go to a video detail page).

Test the following deep-link scenarios:

Deep Links from a Cold Start

A "cold start" refers to the first launch of app after it is installed or after force-stopping the app. Deep-link behavior differs if your app must cold start versus if your app is already in the background.

To test deep links in an authenticated state from a cold start:

  1. Launch your app.
  2. Sign in to your app.
  3. Press the Home button on the remote.
  4. Force stop the app. (Go to Settings > Applications > Manage Installed Applications > [Your app] > Force stop.)
  5. Use Fire TV's universal search to search for your app's media, and then select to watch it with your app.

The deep link should start playback of video (it should not go to a video detail page).

To test deep links in an un-authenticated state from a cold start:

  1. Launch your app.
  2. Sign out of your app (if necessary).
  3. Press the Home button on the remote.
  4. Force stop the app. (Go to Settings > Applications > Manage Installed Applications > [Your app] > Force stop.)
  5. Use Fire TV's universal search to search for your app's media, and then select to watch it with your app.

The deep link should take you to the authentication/sign up screen. After successful authentication, the video should start to play.

Deep Links with App in Background

To test deep links in an authenticated stage while your app is in the background:

  1. Launch your app.
  2. Sign in to your app.
  3. Press the Home button on the remote.
  4. Use Fire TV's universal search to search for your app's media, and then select to watch it with your app.

The deep link should start playback of video (it should not go to a video detail page).

To test deep links in an un-authenticated stage while your app is in the background:

  1. Launch your app.
  2. Sign out of your app (if necessary).
  3. Press the Home button on the remote.
  4. Use Fire TV's universal search to search for your app's media, and then select to watch it with your app.

The deep link should take you to the authentication/sign up screen. After successful authentication, the video should start to play.

Deep Links with a Video Playing

To test deep links in an authenticated state while a video is playing:

  1. Launch your app.
  2. Sign in to your app.
  3. Start watching a video in your app.
  4. Do one of the following:

    • If your app does integrate the Video Skills Kit (VSK), press Home on the remote. Then use text or voice to search for another video.
    • If you app doesn't integrate the Video Skills Kit (VSK), use voice search for another video.
  5. From the results shown, select to watch the content with your app.

The deep link should start playback of video (it should not go to a video detail page).

To test deep links in an un-authenticated state while a video is playing:

  1. Launch your app.
  2. Sign out of your app (if necessary).
  3. Do one of the following:

    • If your app integrates the Video Skills Kit (VSK), press Home on the remote. Then use text or voice to search for another video.
    • If you app doesn't integrate the Video Skills Kit (VSK), use voice search for another video.
  4. Select your app to watch the content.

The deep link should take you to the authentication/sign up screen. After successful authentication, the video should start to play.

Test Case: Back button Returns User to Search Results

This test case will check for proper behavior with the Back button.

  1. From the Fire TV home screen, search for media from your app.
  2. Select to play the content with your app.
  3. Press the Back button. Pressing the Back button should eventually take you back to the search results.

Test Case: Sending an Invalid Content ID

Another test case that you should execute is sending an invalid content ID to your app to make sure that your app handles this condition gracefully. If your app does not handle this condition gracefully, re-visit your error handling code and make changes as appropriate.

To test sending an invalid content ID to your app:

  1. Download or sideload your app to your Fire TV device.
  2. Sign in and/or activate a subscription to your app, if necessary.
  3. Use either the Test App (see Test Fire TV Launcher Integration with the Integration Test App) or adb commands (see Test Launcher Integration with adb) to send an invalid ID to your app.
  4. Send a valid ID first to make sure the content launches properly.
  5. Test the following invalid ID conditions:
    • Send an invalid ID using numerals.
    • Send an invalid ID using alphabetical characters.
    • Send an invalid ID using a mix of numbers and letters.
  6. Verify that when sending invalid IDs, your app handles the intent gracefully.

The app should launch and leave the user on the main screen within your app. Alternatively, your app should provide appropriate messaging, such as "Sorry, the content you select is no longer available." If the user is not taken to the main screen within your app, or no messaging appears, modify your error handling code to do so.

Additional Testing

You can optionally perform additional testing with your catalog content by following these two topics: