Younify Connect SDK main object.

Use the shared singleton instance to interact with the sdk. Before the sdk can be meaningfully used configure must be called.

Implements

Implemented by

Constructors

Properties

instance: Connect
_logListener: null | LogListener = null
_logListenerSubscriptions: EmitterSubscription[] = ...
_tokenHandler: null | TokenHandler = null
_tokenHandlerSubscriptions: EmitterSubscription[] = ...
_nextRequestId: number = 0

Accessors

Methods

  • Configures the SDK with the specified options.

    Parameters

    • options: ConnectOptions

      The configuration options.

      Before using the sdk it must be configured by using this method with a valid ConnectOptions instance. It is safe to call this method repeatedly to change the options dynamically at runtime if desired.

    Returns Promise<void>

  • Parameters

    Returns Promise<void>

  • Sets the user's tokens.

    Parameters

    • accessToken: null | string

      The user's access token.

    • refreshToken: null | string

      The user's refresh token.

      Set the user's access and refresh tokens that are required for accessing streaming services. User tokens can be obtained by creating a user object from the backend api.

    Returns Promise<void>

  • Parameters

    • accessToken: null | string
    • refreshToken: null | string

    Returns Promise<void>

  • Link a streaming service.

    Parameters

    Returns Promise<boolean>

    A boolean indicating whether the service was linked or not.

    Opens the service linking flow which involves a web view login for the specified service followed by profile selection and optional pin collection if supported. If linking is successful, the success flag will be true. If linking was canceled then the success flag will be false. If linking fails the promise will reject.

  • Parameters

    Returns Promise<boolean>

  • Manage a linked service.

    Parameters

    Returns Promise<void>

    The service object that was managed.

    Opens the linked service management flow which allows the user to change their profile selection and pin if supported.

  • Parameters

    Returns Promise<void>

  • Unlink a linked service.

    Parameters

    Returns Promise<void>

    The service object that was unlinked.

  • Parameters

    Returns Promise<void>

  • Fetch streaming category contents.

    Parameters

    • categories: StreamingCategory[]

      The list of categories to fetch content for.

    • services: StreamingService[]

      The list of streaming services to fetch content for.

    • serviceError: null | ((service, error) => void)

      The optional error handler to call when a problem occurs accessing a service.

    • categoryServiceComplete: null | ((category, service, content, error) => void)

      The optional completion handler to call when retrieving content for a single category and service.

    • cancellationTicket: null | CancellationTicket

      The ticket to manually cancel the operation.

    Returns Promise<FetchContentCategoryResult[]>

    Complete fetched content for all services and all categories or an empty array if categoryServiceComplete is non-null.

    Retrieves the content for the categories and services specified. serviceError will be called when a service error occurs. categoryServiceComplete will be called with the results for a single category-service pair. Specifying this callback will cause the response promise to resolve with an empty array for performance.

  • Parameters

    Returns Promise<FetchContentCategoryResult[]>

  • Fetch content children.

    Parameters

    Returns Promise<StreamingContent[]>

    The children of the requested content item.

    Retrives the children of the given parent content object. The content object must be a folder to have children.

    Examples include using a content that represents a series where the children would be its seasons, or a content that represents a season where the children would be its episodes.

  • Parameters

    Returns Promise<StreamingContent[]>

  • Fetch an image.

    Parameters

    • url: string

      The image url to fetch.

    Returns Promise<string>

    Image data as a base64 string.

    Retrieves the image from the specified image url.

    Directly fetching image urls in any other way can lead to missing data or 404s depending on the streaming service.

  • Parameters

    • url: string

    Returns Promise<string>

  • Type Parameters

    • T

    Parameters

    • f: BridgeInvoker<T>
    • h: BridgeResultHandler

    Returns Promise<T>