Class Recommendation


  • public class Recommendation
    extends java.lang.Object
    The Recommendation service provides media suggestions to passengers on a flight. These recommendations are based on the passenger's profile preferences, such as playlist, bookmarks and viewing history; similar media, such as the next episode in a television show; and media trending, as defined by the viewing patterns of passengers on the flight.
    • Method Detail

      • initService

        public static void initService​(Context context,
                                       IInFlightCallback inFlightCallback,
                                       InFlight inFlight)
        This api is the starting point for Recommendation. The service object will be provided via IInFlightCallback once it has been initialized.
        Parameters:
        context - - Activity Context
        inFlightCallback - IInFlightCallback - this callback will be invoked once service has been initialized.
        inFlight - - Reference of InFlight
        Example:
         Recommendation.initService(context, inflightCallbackListener);
        
         public void onInitServiceComplete(Object serviceObj,String serviceName) {
                if(serviceName.equals(InFlightServices.RECOMMENDATION_V1_SERVICE.getServiceName()) {
                        mRecommendation = (Recommendation) serviceObj;
                }
         }
         
      • getSimilarMedia

        public void getSimilarMedia​(java.lang.String contentType,
                                    java.util.List<java.lang.String> mediaURIs,
                                    MediaSimilarRequestAttribute similarMediaAttr,
                                    Recommendation.OnMediaRecommendationReceivedListener onMediaRecommendationReceivedListener)
        Returns a list of media URIs that are similar to the content of the specified media_uri. The returned list defaults to 10 items and displays in descending order.

        The results can be filtered by media content, media category and request limit. Additionally, specific media URIs can be filtered out by specifying a list of blacklist_uris.

        Parameters:
        mediaURIs - Media URIs to use in finding similar content.
        contentType - Content type of media to filter. Example: media.video.movie, media.audio.album
        similarMediaAttr - Additional optional parameters, such as category and request limit, to be included in search.
        onMediaRecommendationReceivedListener - This will be executed upon error or completion of the request.

      • getRecommendations

        public void getRecommendations​(java.lang.String contentType,
                                       MediaRecommendationRequestAttribute recommendationMediaAttr,
                                       Recommendation.OnMediaRecommendationReceivedListener onMediaRecommendationReceivedListener)
        Returns a list of similar media URI items based on passenger's viewing history, playlist, bookmarks, and explicit preferences in their passenger profile. The returned list defaults to 10 items and displays in descending order.

        The results can be filtered by media content, media category and request limit. Additionally, specific media URIs can be filtered out by specifying a list of blacklist_uris.

        Parameters:
        contentType - Content type of media to filter. Example: media.video.movie, media.audio.album
        recommendationMediaAttr - Additional optional parameters, such as category and request limit, to be included in search.
        onMediaRecommendationReceivedListener - This will be executed upon error or completion of the request.

      • getTrendingMedia

        public void getTrendingMedia​(java.lang.String contentType,
                                     MediaTrendingRequestAttribute trendingMediaAttr,
                                     Recommendation.OnMediaRecommendationReceivedListener onMediaRecommendationReceivedListener)
        Returns a list of media URIs currently/recently watched on the flight (from all passengers on that flight). The trending values are based on the number of passengers viewing the media on the flight The returned list defaults to 10 items and displays in descending order.

        The results can be filtered by media content, media category and request limit. Additionally, specific media URIs can be filtered out by specifying a list of blacklist_uris.

        Parameters:
        contentType - Content type of media to filter. Example: media.video.movie, media.audio.album
        trendingMediaAttr - Additional optional parameters, such as blacklist, to be included in search.
        onMediaRecommendationReceivedListener - This will be executed upon error or completion of the request.

      • getEnsembleMedia

        public void getEnsembleMedia​(java.lang.String contentType,
                                     MediaEnsembleRequestAttribute ensembleMediaAttr,
                                     Recommendation.OnMediaRecommendationReceivedListener onMediaRecommendationReceivedListener)
        Returns a list of mutually exclusive list of recommendations and popular items. The returned list defaults to 5 recommendations and 5 popular items.

        The results can be filtered by media content, media category and request limit. Additionally, specific media URIs can be filtered out by specifying a list of blacklist_uris.

        Parameters:
        contentType - Content type of media to filter. Example: media.video.movie, media.audio.album
        ensembleMediaAttr - Additional optional parameters, such as history, playlist and seat number, to be included in search.
        onMediaRecommendationReceivedListener - This will be executed upon error or completion of the request.

      • getGenre

        public void getGenre​(java.lang.String contentType,
                             java.lang.String langIso,
                             Recommendation.OnGenreReceivedListener onGenreReceivedListener)
        Fetches a list of genres available for the specified content type.

        The results can be filtered by the content type and language. The method uses the provided listener to handle the response or any error that occurs during the request.

        Parameters:
        contentType - The type of content to filter genres by. Example: media.video.movie, media.audio.album.
        langIso - The ISO 639-1 language code for filtering genres by language. Example: "en" for English, "fr" for French.
        onGenreReceivedListener - This listener will be executed upon receiving the genre list or encountering an error.
      • cancel

        public void cancel()
        Cancels all requests made using this recommendation object