The cloud interface provides a binding to the Cloud SDK.
On non-cloud builds, an CYINullInterface interface (NOP) will be returned. On cloud builds, the interface will forward function calls to the Cloud SDK.
#include <YiNullInterface.h>
Public Member Functions | |
CYINullInterface ()=default | |
virtual | ~CYINullInterface () |
virtual bool | IsCloudServer () override |
Returns true if the implementation is a cloud server. More... | |
virtual bool | IsUsingNullRenderer () const override |
Return true if the cloud sdk is using the null renderer. More... | |
virtual bool | SendFocusMap (CYISceneManager *=nullptr) override |
Send a generated focus map to the client. More... | |
virtual bool | SetExportHint (CYISceneNode *, const CYIString &, const CYIString &) override |
Apply the given export hint to a scene node. More... | |
virtual void | SetIncomingFocusStyle (CYIListView *, ListIncomingFocusStyle) override |
Used to set up how focus will be calculated when list recieves focus from another item. More... | |
virtual void | SetOutgoingFocusStyle (CYIListView *, ListOutgoingFocusStyle) override |
Used to set up how focus will be calculated when list recieves focus from another item. More... | |
virtual void | SetInitalScrollIndexWithFocus (CYIListView *, uint32_t) override |
Call setInitalScrollIndexWithFocus to set the initial scroll index of the list. This method will also set focus to the corresponding list item. It this API called in a react native application, it should be called via onLoad. Please do not call this method from other RN life cycle methods as this can cause incorrect application behaviour (The focus request is delayed until after the client receives the new scene graph update). More... | |
virtual bool | SetVideoNodeProperties (const CYIBundle &) override |
Add video node properties such as content metadata including DRM configuration, notificationInterval, etc. More... | |
virtual bool | SetVideoSurfaceProperties (const CYIBundle &, CYIVideoSurfaceView *) override |
Set the video surface view properties. More... | |
virtual const CYIClientPlayer::PlaybackSessionInfo & | GetLastPlaybackSessionInfo () const override |
Get the recently updated playback session information such as bookmark and audio/cc settings. More... | |
virtual void | SetFocusOnSceneNode (const CYISceneNode *) override |
Set client focus on the specified scene node. More... | |
virtual void | ClearClientFocus () override |
Clear the client's focus. The server will then push its own focus state once a view has focus. More... | |
virtual bool | IsLowEndDevice () override |
Returns true if the device is low end. More... | |
virtual void | InvokeCommand (const CYIString, const CYIBundle &, CYIClientCallback) override |
Invoke custom client command. More... | |
virtual const CYIString & | GetClientExternalIp () const override |
Return the external IP of the client. More... | |
virtual const CYIString & | GetClientLocalIp () const override |
Return the local IP of the client. More... | |
virtual const glm::vec2 | GetClientUIResolution () const override |
Returns the UI resolution of the client. More... | |
virtual void | TerminateApplication () override |
Terminate the Application and return to the home screen. More... | |
virtual void | SetDisconnectOnInactivityEnabled (bool) override |
Sets whether disconnect on inactivity is enabled or disabled for the application. More... | |
virtual void | ShowWaitSpinnerNow () override |
Show the wait spinner right away. More... | |
virtual void | SetSpinnerDelayMs (uint32_t) override |
Sets the time of spinner delay in milliseconds. More... | |
virtual void | ShowWaitSpinner () override |
Show the wait spinner with configured delay. More... | |
virtual void | HideWaitSpinner () override |
Hide the wait spinner. More... | |
virtual void | SetWaitSpinnerAccessibilityAttributes (CYIAccessibilityAttributes::Accessible, std::unique_ptr< const CYIAccessibilityAttributes >) override |
Configure CYIAccessibilityAttributes and accessibility of the Roku wait spinner. More... | |
virtual void | AddModalScene (const CYIString &, const CYISceneNode *, int32_t=0, std::set< CYIString >=std::set< CYIString >()) override |
Identify overlay scene to be exported with initial components. More... | |
virtual void | RemoveModalScene (const CYIString &) override |
Remove an overlay scene from the set of registered modals. More... | |
virtual void | SendScrollToNode (const CYIScrollingView *, const CYISceneNode *) override |
Scroll the given scrolling view to the provided node. More... | |
virtual void | SendScrollingTextViewUpdate (const CYISceneNode *, const CYIString &, const CYIString &) override |
Update the text for a scrolling text view. More... | |
virtual void | SetDefaultCloudKeyboardTitle (const CYIString &) override |
Set the title string that will be shown when the keyboard is displayed. The default title will be superceded by an element with a title hint. More... | |
virtual const CYIString & | GetDefaultCloudKeyboardTitle () const override |
Get currently set default title for the cloud device. More... | |
virtual uint64_t | RegisterDataListener (CYIString eventId, std::function< bool(CYIString eventId, const yi::rapidjson::Document *pEvent)> handler) override |
Register a data listener so that it may receive client data. More... | |
virtual void | UnregisterDataListener (CYIString eventId, uint64_t listenerId) override |
Unregister a data listener so that it no longer receives client data. More... | |
virtual void | RegisterPersistentStore (const CYIString &, CYIPersistentStore *) override |
Register the given persistent store object for synchronization with the client. More... | |
virtual void | UnregisterPersistentStore (CYIPersistentStore *) override |
Unregister the given persistent object so that it is no longer synchronized with the client. More... | |
virtual void | SendRokuAnalyticsEvent (const CYIString &, const CYIString &) override |
Send the given event and paramaters to the Roku analytics framework. More... | |
virtual void | GetIAPCustomerUID (std::function< void(const CloudIAPRequestStatus &, const CloudIAPCustomerUID &)>) override |
virtual void | GetChannelCredentials (std::function< void(const CloudIAPRequestStatus &, const CloudIAPChannelCredentials &channelCredentials)>) override |
virtual void | SaveChannelCredentials (const CYIString &, std::function< void(const CloudIAPRequestStatus &status)>) override |
Request saving the client in-app purchase channel credentials. This is an asynchronous network operation. The given responder will be invoked when complete. More... | |
virtual void | GetIAPUser (std::function< void(const CloudIAPRequestStatus &, const CloudIAPUser &)>) override |
virtual void | GetAvailableProducts (std::function< void(const CloudIAPRequestStatus &, const std::vector< std::shared_ptr< CloudIAPProduct >> &)>) override |
In app purchases request of available products for the channel This is an asynchronous network operation. The given responder will be invoked when complete. More... | |
virtual void | GetUserPurchases (std::function< void(const CloudIAPRequestStatus &, const std::vector< std::shared_ptr< CloudIAPPurchase >> &)>) override |
In app purchases request of user purchases This is an asynchronous network operation. The given responder will be invoked when complete. More... | |
virtual void | RequestPurchase (const CYIString &, std::function< void(const CloudIAPRequestStatus &, const CloudIAPReceipt &)>) override |
virtual bool | SetVideoPlayerColor (CYIAbstractVideoPlayer *, const CYIColor &) override |
Set the color of the video player controls. Note: Must be called after a video surface view has been associated with the player. More... | |
virtual void | SendStopVideo () override |
Sends a 'stop' command to the active video node. More... | |
virtual bool | ContentOverlaySetState (const CYIContentOverlay *, const CYIContentOverlay::State &) override |
Attempt to set the content overlay to the provided state. Configured parameters for that state will be triggered like animations and initial focus if set. More... | |
virtual void | SendStopAnimation (const CYIString &, const CYISceneNode *) override |
Sends a message to the client to stop the given animation. More... | |
virtual void | SendEpgContent (CYISceneNode *, const CloudEpgContentModel &) override |
Sends updated EPG content data. Notes: The given node must be specified as an EPG Grid with EXPORT_CLASS_NAME = "CYIEpgGridView". More... | |
virtual void | SendFocusEpgProgram (CYISceneNode *, const CYIString &, const int64_t) override |
Sends request focus to the specified program with given channel title and start time. More... | |
virtual void | ReplaceSubtree (const CYISceneNode *, bool) override |
Replace the given subtree on the client. A common use of this method is to update the content data of a list. Example: ReplaceSubtree(pListView, true) More... | |
virtual void | SendErrorMessage (const CYIString &) override |
Send the given string to be displayed as a Roku error message. More... | |
virtual void | SendAccessibilityAnnouncement (const CYIString &) override |
Send the given accessibility message to be announced on the client. More... | |
virtual void | PauseExportUpdates () override |
Pauses the automatic export process. Until resumed, changes to the scene tree will not result in automated exports. More... | |
virtual void | ResumeExportUpdates () override |
Resumes the automatic export process. Changes to the scene tree will again result in automated exports. More... | |
virtual bool | AreExportUpdatesPaused () override |
Returns true if the automatic export process is paused. More... | |
virtual void | SetNavigationPersistenceKey (const CYIString &) override |
Sets the persistence key for the navigate state. App will save the navigation history only if this gets called at the time of App::UserStart(). More... | |
virtual const CYIString & | GetStatus () const override |
Gets the stringified cloud app status from client. More... | |
virtual const CYIString & | GetSavedInstanceState () const override |
Retrieve the stringified saved state. More... | |
virtual void | SaveInstanceState (const CYIString &) override |
Provide the stringified state of the application to be used when restarting the app instance. More... | |
virtual void | EnqueuePostExportAction (std::function< void()>) override |
Enqueue an action that will execute after the next scene export. More... | |
virtual std::shared_ptr< CYIPersistentStore > | FindUnusedPersistentStore (const CYIString &) override |
Retrieve a persistent store containing data that was not stored when the app is started. More... | |
virtual void | SendAppBeacon (const CYIString &) override |
Sends an app beacon of the provided name to the client. More... | |
virtual void | SendPlatformAnalyticsEvent (PlatformAnalyticsType, const CYIString &) override |
Sends an platform analytcs to the client. More... | |
![]() | |
CYICloudInterface ()=default | |
virtual | ~CYICloudInterface () |
virtual void | GetIAPCustomerUID (std::function< void(const CloudIAPRequestStatus &status, const CloudIAPCustomerUID &customerUID)> responder)=0 |
Request the client in-app purchase customer unique ID. This is an asynchronous network operation. The given responder will be invoked when complete. More... | |
virtual void | GetChannelCredentials (std::function< void(const CloudIAPRequestStatus &status, const CloudIAPChannelCredentials &channelCredentials)> responder)=0 |
Request getting the client in-app purchase channel credentials. This is an asynchronous network operation. The given responder will be invoked when complete. More... | |
virtual void | GetIAPUser (std::function< void(const CloudIAPRequestStatus &status, const CloudIAPUser &iapUser)> responder)=0 |
Request the client in-app purchase user account. This is an asynchronous network operation. The given responder will be invoked when complete. More... | |
virtual void | RequestPurchase (const CYIString &productId, std::function< void(const CloudIAPRequestStatus &status, const CloudIAPReceipt &receipt)> responder)=0 |
In app purchases request to purchase a given product This is an asynchronous network operation. The given responder will be invoked when complete. More... | |
Protected Member Functions | |
virtual void | AddUnusedPersistentStoreData (const CYIString &, yi::rapidjson::Value *) override |
Adds data to the list of unused persistent store data. More... | |
|
default |
|
inlinevirtual |
|
inlineoverridevirtual |
Identify overlay scene to be exported with initial components.
name | is the name of the modal scene. |
pSceneNode | is the node of the modal scene. |
layerIndex | is the index of the scene layer. |
associatedScenes | is the set of scenes this modal should be included with when exporting the component library. If empty, the modal will be included in all scenes. |
Implements CYICloudInterface.
|
inlineoverrideprotectedvirtual |
Adds data to the list of unused persistent store data.
This function is needed to support the recreation of the Async Storage module when a React Native app is live reloaded.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Returns true if the automatic export process is paused.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Clear the client's focus. The server will then push its own focus state once a view has focus.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Attempt to set the content overlay to the provided state. Configured parameters for that state will be triggered like animations and initial focus if set.
pNode | the engine scene view to perform the operations on. This node must have been configured as a content overlay using the ConfigureContentOverlay interface |
state | the target state to attempt to transition the overlay to |
Implements CYICloudInterface.
|
inlineoverridevirtual |
Enqueue an action that will execute after the next scene export.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Retrieve a persistent store containing data that was not stored when the app is started.
In react native apps, the Async Storage module is lazy instantiated, so data not laoded into an existing store at load time is retained for when it is created. If no persistent store is found with the given name, nullptr is returned.
Implements CYICloudInterface.
|
inlineoverridevirtual |
In app purchases request of available products for the channel This is an asynchronous network operation. The given responder will be invoked when complete.
Implements CYICloudInterface.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Return the external IP of the client.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Return the local IP of the client.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Returns the UI resolution of the client.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Get currently set default title for the cloud device.
Implements CYICloudInterface.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Get the recently updated playback session information such as bookmark and audio/cc settings.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Retrieve the stringified saved state.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Gets the stringified cloud app status from client.
When a new server instance gets created by reconnection request from a client, a set of context information will be provided. The context information will contain the statusCode, errorCode and errorMessage. The errorCode and errorMessage will be provided only when reconnecting with error situation. This is read only.
Implements CYICloudInterface.
|
inlineoverridevirtual |
In app purchases request of user purchases This is an asynchronous network operation. The given responder will be invoked when complete.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Hide the wait spinner.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Invoke custom client command.
cmd | is the name of the custom command. |
args | a map of argument name and value pairs. Value is CYIAny but limited to simple types such as int, bool and string. |
callback | is called with the result of the custom command. |
Implements CYICloudInterface.
|
inlineoverridevirtual |
Returns true if the implementation is a cloud server.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Returns true if the device is low end.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Return true if the cloud sdk is using the null renderer.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Pauses the automatic export process. Until resumed, changes to the scene tree will not result in automated exports.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Register a data listener so that it may receive client data.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Register the given persistent store object for synchronization with the client.
Each CYIPersistentObject is mapped to a unique Roku object specified by the 'name' parameter. Earlier versions of the Roku Client synchronized all CYIPersistentStore objects with a single, hardcoded Roku object, called "PersistentStore." When upgrading from an older Cloud version to a current version, you'll need to RegisterPersistentStore() using "PersistentStore" as the name in order to retrieve persistent data saved under the old version. This function must be called in your app's UserInit function.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Remove an overlay scene from the set of registered modals.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Replace the given subtree on the client. A common use of this method is to update the content data of a list. Example: ReplaceSubtree(pListView, true)
pSubtreeRootNode | is the root of the subtree to update. |
useJSON | deprecated as it is the default |
Implements CYICloudInterface.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Resumes the automatic export process. Changes to the scene tree will again result in automated exports.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Request saving the client in-app purchase channel credentials. This is an asynchronous network operation. The given responder will be invoked when complete.
credentials | is the credentials to save |
responder | is the funtion pointer to be called after performing the request |
Implements CYICloudInterface.
|
inlineoverridevirtual |
Provide the stringified state of the application to be used when restarting the app instance.
SaveInstanceState should be called as a response to the background event from ClientBackgrounded and ScreenSaverWillStart signal. If the ClientBackgrounded signal raised, the application is terminated once its instance state is saved.
stringifiedState | contains the string that will be provided to new incarnation of the application to rebuild the current screen and stacked screen state of the application. |
Implements CYICloudInterface.
|
inlineoverridevirtual |
Send the given accessibility message to be announced on the client.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Sends an app beacon of the provided name to the client.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Sends updated EPG content data. Notes: The given node must be specified as an EPG Grid with EXPORT_CLASS_NAME = "CYIEpgGridView".
Implements CYICloudInterface.
|
inlineoverridevirtual |
Send the given string to be displayed as a Roku error message.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Sends request focus to the specified program with given channel title and start time.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Send a generated focus map to the client.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Sends an platform analytcs to the client.
type | is the analytics type. |
eventName | contains the analytics event name that gets sent by the connected client. |
Some analytics events are required by the platform for their purpose. They are not related to any application-side business logic, but typically they are required by the platform. There are two types were defined, one is "Application", the other one is "Authentication". In the Roku client, the "Application" event messages will be converted to the "App Beacon" messages, and the "Authentication" type messages will be converted to "Roku Event Dispatcher" or "Roku Ads Framework" messages by the configuration of the app "manifest". The message's destination will be defined by the Web or Native clients as necessary in the future. The name of the events and when to send them can be decided are completely up to applications.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Send the given event and paramaters to the Roku analytics framework.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Update the text for a scrolling text view.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Scroll the given scrolling view to the provided node.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Sends a message to the client to stop the given animation.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Sends a 'stop' command to the active video node.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Set the title string that will be shown when the keyboard is displayed. The default title will be superceded by an element with a title hint.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Sets whether disconnect on inactivity is enabled or disabled for the application.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Apply the given export hint to a scene node.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Set client focus on the specified scene node.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Used to set up how focus will be calculated when list recieves focus from another item.
pList | is the list that is being configured. |
focusStyle | is the style of focus. |
Implements CYICloudInterface.
|
inlineoverridevirtual |
Call setInitalScrollIndexWithFocus to set the initial scroll index of the list. This method will also set focus to the corresponding list item. It this API called in a react native application, it should be called via onLoad. Please do not call this method from other RN life cycle methods as this can cause incorrect application behaviour (The focus request is delayed until after the client receives the new scene graph update).
pList | is the list will receive focus. |
index | coresponds to the list item that will receive focus. |
Implements CYICloudInterface.
|
inlineoverridevirtual |
Sets the persistence key for the navigate state. App will save the navigation history only if this gets called at the time of App::UserStart().
persistenceKey | is the key for the persistence store. |
Implements CYICloudInterface.
|
inlineoverridevirtual |
Used to set up how focus will be calculated when list recieves focus from another item.
pList | is the list that is being configured. |
focusStyle | is the style of focus. |
Implements CYICloudInterface.
|
inlineoverridevirtual |
Sets the time of spinner delay in milliseconds.
delayMs | is the duration of delaying before showing in milliseconds. If hiding the spinner gets called within the duration, spinner won't show. Default value is 2000ms for Roku requirement of 3 secs with a second of margin. |
Implements CYICloudInterface.
|
inlineoverridevirtual |
Add video node properties such as content metadata including DRM configuration, notificationInterval, etc.
properties | CYIBundle of video node properties. The JSON document structure should match with the video node fields structure described in https://developer.roku.com/en-ca/docs/references/scenegraph/media-playback-nodes/video.md. Until CS-4192 and CS-4175 done, it can contain "ads" and "analytics" fields. The keys in the bundle have to be always in lower case. |
Implements CYICloudInterface.
|
inlineoverridevirtual |
Set the color of the video player controls. Note: Must be called after a video surface view has been associated with the player.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Set the video surface view properties.
properties | CYIBundle of video surface properties such as exitonvideocomplete, handlebackkeyevent, and shouldautofocus. |
pVideoSurfaceView | the CYIVideoSurfaceView to be used for Video player. If not supplied the video surface view currently associated with the video player is used. |
Implements CYICloudInterface.
|
inlineoverridevirtual |
Configure CYIAccessibilityAttributes and accessibility of the Roku wait spinner.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Show the wait spinner with configured delay.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Show the wait spinner right away.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Terminate the Application and return to the home screen.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Unregister a data listener so that it no longer receives client data.
Implements CYICloudInterface.
|
inlineoverridevirtual |
Unregister the given persistent object so that it is no longer synchronized with the client.
Implements CYICloudInterface.