Skip to content

Commit

Permalink
Enable User Defined Build Settings in Release Channel (expo#2093)
Browse files Browse the repository at this point in the history
Xcode's User Defined Build Settings can (unfortunately) only be used in Info.plist so this allows you to set Expo's Release Channel there. When you're detached, this is helpful in order to automate different Release Channels for dev, staging, prod. Additionally, when you're detached, the Version and Build of the binary should generally be part of release channel as well. Version and Build can be stored in User Defined Build Settings and used to set both CFBundleShortVersionString, CFBundleVersion and as part of ExpoReleaseChannel to avoid duplication.
  • Loading branch information
mjgallag authored and tsapeta committed May 20, 2019
1 parent 0ae677e commit b16fc45
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ios/Exponent/Kernel/Environment/EXEnvironment.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ - (void)_loadShellConfig:(NSDictionary *)shellConfig
[self _loadEmbeddedBundleUrlWithManifest:embeddedManifest];

// load everything else from EXShell
[self _loadMiscPropertiesWithConfig:shellConfig];
[self _loadMiscPropertiesWithConfig:shellConfig andInfoPlist:infoPlist];

[self _setAnalyticsPropertiesWithStandaloneManifestUrl:_standaloneManifestUrl isUserDetached:isUserDetach];
}
Expand Down Expand Up @@ -197,13 +197,17 @@ - (void)_loadUrlSchemeFromInfoPlist:(NSDictionary *)infoPlist
}
}

- (void)_loadMiscPropertiesWithConfig:(NSDictionary *)shellConfig
- (void)_loadMiscPropertiesWithConfig:(NSDictionary *)shellConfig andInfoPlist:(NSDictionary *)infoPlist
{
_isManifestVerificationBypassed = [shellConfig[@"isManifestVerificationBypassed"] boolValue];
_areRemoteUpdatesEnabled = (shellConfig[@"areRemoteUpdatesEnabled"] == nil)
? YES
: [shellConfig[@"areRemoteUpdatesEnabled"] boolValue];
_releaseChannel = (shellConfig[@"releaseChannel"] == nil) ? @"default" : shellConfig[@"releaseChannel"];
if (infoPlist[@"ExpoReleaseChannel"]) {
_releaseChannel = infoPlist[@"ExpoReleaseChannel"];
} else {
_releaseChannel = (shellConfig[@"releaseChannel"] == nil) ? @"default" : shellConfig[@"releaseChannel"];
}
// other shell config goes here
}

Expand Down

0 comments on commit b16fc45

Please sign in to comment.