Persistent Store for Roku Apps

You.i React Native Apps

For You.i React Native, persistent store is implemented through support for the Facebook React Native AsyncStorage module.

C++ Apps

For C++ apps, the Cloud Solution supports synchronizing multiple persistent store objects between the server (app logic) and the Roku client. Some things to keep in mind:

  • Register your CYIPersistentStore in UserInit() function using:

    CYICloud::GetInterface().RegisterPersistentStore("myPersistentStoreObject", &myAppPersistentStore);. Each persistent store needs a unique name.

  • Do not store large objects (such as cached HTTP responses) in your persistent store.
  • The Cloud Solution currently doesn’t support CYISecureStorageBridge.

Also, consider the following if you are working with a You.i C++ earlier than Release 5.0

  • Due to the asynchronous nature of interacting with the Roku client, all operations that return a Boolean return true. If needed, you can troubleshoot using Telnet logs. Also, the file path passed to these operations is ignored by the Cloud Solution. It uses instead data determined when the persistent store is registered.
  • Normally, calling CYIPersistentStore::Load clears persistent store data. However, due the way the Cloud Solution handles persistent storage, data is loaded automatically if stores have been registered in UserInit() and there is no need to call CYIPersistentStore::Load.

When the client connects, a message is sent to the server containing persistent store data. This message is logged in Telnet for debugging purposes.