Share Data Across LynxViews
SessionStorage lets LynxViews read, write, and observe cached data in a WhiteBoard. Cross-view sharing requires native configuration; the API calls alone do not connect the storage of separate LynxViews.
Sharing scope
SessionStorage is scoped to a shared WhiteBoard, not to the entire application. To share data across LynxViews on Android or iOS, configure them with the same LynxGroup instance when creating the views. Creating separate groups with the same name or ID does not share their WhiteBoard.
Android
Enable WhiteBoard explicitly when creating the group; it is disabled by default. Reuse this group for every LynxView that needs to share data:
Keep the shared group alive while these pages need the shared data. Reusing a group without enabling WhiteBoard does not enable cross-view storage sharing.
After all participating LynxViews have been destroyed and the group is no longer needed, call sharedGroup.destroy() to release its native WhiteBoard memory. Dropping the Java reference alone does not release this memory. The owner of the group should perform this cleanup once, rather than having each page destroy the shared group when it exits.
iOS
LynxGroup creates its WhiteBoard during initialization. Reuse the same group instance in the builders for all participating LynxViews.
Without a shared WhiteBoard, each LynxView uses its own storage: a value written in one view cannot be read or observed from another. The same sharing scope applies to getSessionStorageItem, subscribeSessionStorage, and unsubscribeSessionStorage.
Related APIs
Use the API reference for the thread where your code runs.