Skip to content

Commit 8973862

Browse files
author
Josh Deffibaugh
committed
Look up optly project id dynamically to avoid breaking the build.
1 parent d6c17bc commit 8973862

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-app/src/main/java/com/optimizely/ab/android/test_app/MyApplication.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ public void onCreate() {
3636
// If the project doesn't compile because you are missing R.string.optly_project_id you need
3737
// to put `git_ignored_strings.xml` in test-app/src/main/res/values. This file is git ignored.
3838
// It contains values that are unique for each developer.
39-
optimizelyManager = OptimizelyManager.builder(getResources().getString(R.string.optly_project_id))
39+
final String projectId = getResources().getString(
40+
getResources().getIdentifier("optly_project_id", "string", getPackageName()));
41+
optimizelyManager = OptimizelyManager.builder(projectId)
4042
.withEventHandlerDispatchInterval(30, TimeUnit.SECONDS)
4143
.withDataFileDownloadInterval(30, TimeUnit.SECONDS)
4244
.build();

0 commit comments

Comments
 (0)