1 // Copyright © 2021 650 Industries. All rights reserved. 2 3 #import <Foundation/Foundation.h> 4 5 NS_ASSUME_NONNULL_BEGIN 6 7 typedef void (^ABI47_0_0EXUpdatesErrorBlock) (NSError *error); 8 typedef void (^ABI47_0_0EXUpdatesUpdateSuccessBlock) (NSDictionary * _Nullable manifest); 9 typedef void (^ABI47_0_0EXUpdatesQuerySuccessBlock) (NSArray<NSUUID *> * _Nonnull updateIds); 10 typedef void (^ABI47_0_0EXUpdatesProgressBlock) (NSUInteger successfulAssetCount, NSUInteger failedAssetCount, NSUInteger totalAssetCount); 11 /** 12 * Called when a manifest has been downloaded. The return value indicates whether or not to 13 * continue downloading the update described by this manifest. Returning `NO` will abort the 14 * load, and the success block will be immediately called with a nil `manifest`. 15 */ 16 typedef BOOL (^ABI47_0_0EXUpdatesManifestBlock) (NSDictionary *manifest); 17 18 /** 19 * Protocol for modules that depend on expo-updates for loading production updates but do not want 20 * to depend on expo-updates or delegate control to the singleton ABI47_0_0EXUpdatesAppController. 21 */ 22 @protocol ABI47_0_0EXUpdatesExternalInterface 23 24 @property (nonatomic, weak) id bridge; 25 26 - (NSURL *)launchAssetURL; 27 28 - (void)reset; 29 30 - (void)fetchUpdateWithConfiguration:(NSDictionary *)configuration 31 onManifest:(ABI47_0_0EXUpdatesManifestBlock)manifestBlock 32 progress:(ABI47_0_0EXUpdatesProgressBlock)progressBlock 33 success:(ABI47_0_0EXUpdatesUpdateSuccessBlock)successBlock 34 error:(ABI47_0_0EXUpdatesErrorBlock)errorBlock; 35 36 /** 37 * Obtains a list of UUIDs for updates already in the updates DB that are in the READY state. 38 * The success block will pass in the array of UUIDs 39 */ 40 - (void)storedUpdateIdsWithConfiguration:(NSDictionary *)configuration 41 success:(ABI47_0_0EXUpdatesQuerySuccessBlock)successBlock 42 error:(ABI47_0_0EXUpdatesErrorBlock)errorBlock; 43 44 @end 45 46 NS_ASSUME_NONNULL_END 47