1 // Copyright 2015-present 650 Industries. All rights reserved. 2 3 #import <Foundation/Foundation.h> 4 #import "EXTest.h" 5 6 NS_ASSUME_NONNULL_BEGIN 7 8 FOUNDATION_EXPORT NSString * const kEXEmbeddedBundleResourceName; 9 FOUNDATION_EXPORT NSString * const kEXEmbeddedManifestResourceName; 10 11 @interface EXEnvironment : NSObject 12 13 + (instancetype)sharedEnvironment; 14 15 /** 16 * Whether the app is running as a detached/standalone app (true) or as Expo Go (false). 17 */ 18 @property (nonatomic, readonly) BOOL isDetached; 19 20 /** 21 * Whether the app was built with a Debug configuration. 22 */ 23 @property (nonatomic, readonly) BOOL isDebugXCodeScheme; 24 25 /** 26 * The manifest url of the standalone app (if isDetached == true). 27 */ 28 @property (nonatomic, readonly, nullable) NSString *standaloneManifestUrl; 29 30 /** 31 * The custom url scheme for the standalone app (if isDetached == true). 32 */ 33 @property (nonatomic, readonly, nullable) NSString *urlScheme; 34 35 /** 36 * The release channel from which to fetch the standalone app (if isDetached == true). 37 */ 38 @property (nonatomic, readonly, nonnull) NSString *releaseChannel; 39 40 /** 41 * The `bundleUrl` given by the embedded manifest that shipped with this NSBundle, if any. 42 */ 43 @property (nonatomic, readonly) NSString * _Nullable embeddedBundleUrl; 44 45 /** 46 * Contains `standaloneManifestUrl`, and may also contain a local development url for a detached project. 47 */ 48 @property (nonatomic, readonly, nonnull) NSArray *allManifestUrls; 49 50 /** 51 * True by default in ExpoKit apps created with `expo eject`, because the owner of the app needs to 52 * manually modify their App Id to enable keychain sharing. 53 */ 54 @property (nonatomic, readonly) BOOL isManifestVerificationBypassed; 55 56 /** 57 * Whether remote updates are allowed at all for this standalone app. 58 */ 59 @property (nonatomic, readonly) BOOL areRemoteUpdatesEnabled; 60 61 /** 62 * Whether to check for updates to this app automatically on launch. Applies to standalone apps only. 63 */ 64 @property (nonatomic, readonly) BOOL updatesCheckAutomatically; 65 66 /** 67 * Timeout when checking for updates on launch after which to fall back to cache. Applies to standalone apps only. 68 */ 69 @property (nonatomic, readonly) NSNumber *updatesFallbackToCacheTimeout; 70 71 /** 72 * Whether the app is running in a test environment (local Xcode test target, CI, or not at all). 73 */ 74 @property (nonatomic, assign) EXTestEnvironment testEnvironment; 75 76 /** 77 * True if the given string is not null and equals self.urlScheme 78 */ 79 - (BOOL)isStandaloneUrlScheme:(NSString *)scheme; 80 81 /** 82 * True if urlScheme is nonnull. 83 */ 84 - (BOOL)hasUrlScheme; 85 86 @end 87 88 NS_ASSUME_NONNULL_END 89