// Get the information about all cached mini programs// @return Mini program array <TMFMiniAppInfo>+ (NSArray<TMFMiniAppInfo *> *)loadAllAppletsFromCache;
// Get the storage information for a specified mini program// @param appid - The appid of the mini program// @param error - The error object// @return The storage information for the mini program+ (TMACacheInfo *)fetchStorageInfoForAppId:(NSString *)appId error:(NSError **)error;
/// Clear user data+ (void)clearUserDataWithAppId:(NSString *)appId completion:(void(^)(NSError * _Nullable error))completion;
/// Clear mini program package files+ (void)clearPackageWithAppId:(NSString *)appId completion:(void(^)(NSError * _Nullable error))completion;
/// Clear all storage contents+ (void)clearAllStorageWithAppId:(NSString *)appId completion:(void(^)(NSError * _Nullable error))completion;
NSArray<TMFMiniAppInfo *> *appInfos = [TMACacheManager loadAllAppletsFromCache];NSMutableArray *dataSource = [NSMutableArray array];for (TMFMiniAppInfo *appInfo in appInfos) {NSError *error = nil;TMACacheInfo *cacheInfo = [TMACacheManager fetchStorageInfoForAppId:appInfo.appId error:&error];if (cacheInfo) {NSLog(@"appId:%@,cacheInfo:%ld,userDataSize:%ld,totalSize:%ld",appInfo.appId,cacheInfo.packageSize,cacheInfo.userDataSize,cacheInfo.totalSize);}}
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback