How to Pull Configurations and Resources by Scene?
I. Use Cases
Shiply supports user-defined scenes. By associating scene IDs with configurations/resources, you can batch pull delivered configurations or resources associated with a scene via scene ID. For example: you can define a "Member Center" scene and batch download all resources under that scene before entering the page.
II. Usage Steps
2.1 Create or Query Scene IDs
- After creating a scene, the SDK pulls remote configurations or resources bound to the scene via scene ID
- Supports querying all configurations associated with a scene

2.2 Associate Scenes in Configuration & Switches

Scene association is a critical change and requires secondary confirmation in a dialog.

2.3 Associate Scenes in Resources & Release

2.4 Notes
- After associating scenes in configurations/resources, you need to create a new task or modify and republish an existing task for the association to take effect.
III. SDK Pull Resources Under a Scene
3.1 iOS SDK
Asynchronously pull multiple latest remote resources by scene ID (recommended):
///
/// Resource loading strategy:
/// 1. Return the latest resource when possible. Even if a local copy exists, fetch the latest package per remote config first.
/// 2. If the update fails, invoke the failure callback and return the latest local package.
///
/// Notes:
/// 1. Because this fetches the latest resource, repeated calls may return different versions.
/// 2. To keep the same version for a specific resource during process lifetime, use the version-locked API.
///
/// @param sceneId Scene ID
/// @param progressBlock Progress callback
/// @param completedBlock Completion callback
- (void)batchLoadLatestWithSceneId:(NSString *)sceneId
progress:(nullable ResHubBatchLoadProgressBlock)progressBlock
completed:(nullable ResHubBatchLoadCompletionBlock)completedBlock;
Asynchronously pull locked versions of multiple resources by scene ID (use as needed)
Locked version: When a resource updates to the latest version, a restart is required for the update to take effect. Before restart, the version locked at initial load is maintained.
///
/// Resource loading strategy:
/// 1. If a locally locked version exists, return it first and check for updates.
/// 2. If no locked version exists locally, wait for the network request, lock the version, then return it.
///
/// Notes:
/// Repeated calls during process lifetime return resources of the same version.
///
/// @param sceneId Scene ID
/// @param progressBlock Progress callback
/// @param completedBlock Completion callback
- (void)batchLoadWithSceneId:(NSString *)sceneId
progress:(nullable ResHubBatchLoadProgressBlock)progressBlock
completed:(nullable ResHubBatchLoadCompletionBlock)completedBlock;