|
@@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
#pragma mark - For Theme Data Sync
|
|
|
/// Download the give themeId
|
|
|
/// @discussion themeId may not the key for storage system, the interface layer should fetch the themeId-downloadURL pairs from server first, then call fetchThemeData method to start download contents. Must be settled before call fetchThemeData:completion:
|
|
|
-@property (nonatomic, copy, nullable) void (^downloadBlock)(NSString *themeId, NSString *writeToPath, void (^)(BOOL success, NSString *reason));
|
|
|
+@property (nonatomic, copy, nullable) void (^downloadBlock)(NSString *themeId, NSString *writeToPath, void (^)(BOOL success, NSString *reason, NSString * _Nullable versionHash));
|
|
|
|
|
|
/// block will called when theme engine loaded, should return a default theme identifier
|
|
|
/// @discussion should be set on `moduleLoadedWithArgs:`, the block will called after main framework prepared
|
|
@@ -45,10 +45,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
/// Fetch spec data with specified themeId
|
|
|
/// @param themeId The id of theme, possible pure number indicate downloaded resources, english words indicate bundle resources
|
|
|
+/// @param versionHash The required hash. If given and not equal than the local download theme, will discard local data and call downloadBlock again
|
|
|
/// @param completion finish block
|
|
|
/// @discussion If theme data exists in local, will call completion sync
|
|
|
/// @discussion If theme data not exists in local, will download first and call completion async
|
|
|
-- (void)fetchThemeData:(NSString *)themeId completion:(nullable void (^)(BOOL success, NSString *errorReason, XCThemeSpecModel *spec))completion;
|
|
|
+- (void)fetchThemeData:(NSString *)themeId versionHash:(nullable NSString *)versionHash completion:(nullable void (^)(BOOL success, NSString *errorReason, XCThemeSpecModel *spec))completion;
|
|
|
|
|
|
/// Must exists, return the current selected theme
|
|
|
/// @discussion Theme always contains systemDark, systemLight or systemAdaptive, so the return value must not null
|