// Copyright 2020-present 650 Industries. All rights reserved. #if __has_include() #import "EXUpdatesBinding.h" NS_ASSUME_NONNULL_BEGIN @interface EXUpdatesBinding () @property (nonatomic, strong) NSString *scopeKey; @property (nonatomic, weak) id updatesKernelService; @property (nonatomic, weak) id databaseKernelService; @end @implementation EXUpdatesBinding : EXUpdatesService - (instancetype)initWithScopeKey:(NSString *)scopeKey updatesKernelService:(id)updatesKernelService databaseKernelService:(id)databaseKernelService { if (self = [super init]) { _scopeKey = scopeKey; _updatesKernelService = updatesKernelService; _databaseKernelService = databaseKernelService; } return self; } - (EXUpdatesConfig *)config { return [_updatesKernelService configForScopeKey:_scopeKey]; } - (EXUpdatesDatabase *)database { return _databaseKernelService.database; } - (EXUpdatesSelectionPolicy *)selectionPolicy { return [_updatesKernelService selectionPolicyForScopeKey:_scopeKey]; } - (NSURL *)directory { return _databaseKernelService.updatesDirectory; } - (nullable EXUpdatesUpdate *)launchedUpdate { return [_updatesKernelService launchedUpdateForScopeKey:_scopeKey]; } - (nullable NSDictionary *)assetFilesMap { return [_updatesKernelService assetFilesMapForScopeKey:_scopeKey]; } - (BOOL)isUsingEmbeddedAssets { return [_updatesKernelService isUsingEmbeddedAssetsForScopeKey:_scopeKey]; } - (BOOL)isStarted { return [_updatesKernelService isStartedForScopeKey:_scopeKey]; } - (BOOL)isEmergencyLaunch { return [_updatesKernelService isEmergencyLaunchForScopeKey:_scopeKey]; } - (BOOL)canRelaunch { return YES; } - (void)requestRelaunchWithCompletion:(EXUpdatesAppRelaunchCompletionBlock)completion { return [_updatesKernelService requestRelaunchForScopeKey:_scopeKey withCompletion:completion]; } - (void)resetSelectionPolicy { // no-op in managed } @end NS_ASSUME_NONNULL_END #endif