// Copyright © 2020 650 Industries. All rights reserved. #import #import #import #import #import NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(NSInteger, EXUpdatesBackgroundUpdateStatus) { EXUpdatesBackgroundUpdateStatusError = 0, EXUpdatesBackgroundUpdateStatusNoUpdateAvailable = 1, EXUpdatesBackgroundUpdateStatusUpdateAvailable = 2 }; @class EXUpdatesAppLoaderTask; @protocol EXUpdatesAppLoaderTaskDelegate /** * This method gives the delegate a backdoor option to ignore the cached update and force * a remote load if it decides the cached update is not runnable. Returning NO from this * callback will force a remote load, overriding the timeout and configuration settings for * whether or not to check for a remote update. Returning YES from this callback will make * EXUpdatesAppLoaderTask proceed as usual. */ - (BOOL)appLoaderTask:(EXUpdatesAppLoaderTask *)appLoaderTask didLoadCachedUpdate:(EXUpdatesUpdate *)update; - (void)appLoaderTask:(EXUpdatesAppLoaderTask *)appLoaderTask didStartLoadingUpdate:(EXUpdatesUpdate *)update; - (void)appLoaderTask:(EXUpdatesAppLoaderTask *)appLoaderTask didFinishWithLauncher:(id)launcher isUpToDate:(BOOL)isUpToDate; - (void)appLoaderTask:(EXUpdatesAppLoaderTask *)appLoaderTask didFinishWithError:(NSError *)error; - (void)appLoaderTask:(EXUpdatesAppLoaderTask *)appLoaderTask didFinishBackgroundUpdateWithStatus:(EXUpdatesBackgroundUpdateStatus)status update:(nullable EXUpdatesUpdate *)update error:(nullable NSError *)error; @end @interface EXUpdatesAppLoaderTask : NSObject @property (nonatomic, weak) id delegate; - (instancetype)initWithConfig:(EXUpdatesConfig *)config database:(EXUpdatesDatabase *)database directory:(NSURL *)directory selectionPolicy:(id)selectionPolicy delegateQueue:(dispatch_queue_t)delegateQueue; - (void)start; @end NS_ASSUME_NONNULL_END